Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue-cli-service build target wc not honoring name for registering custom element #1146

Closed
ChristianMurphy opened this issue Apr 18, 2018 · 1 comment · Fixed by #1182
Closed

Comments

@ChristianMurphy
Copy link

ChristianMurphy commented Apr 18, 2018

Version

3.0.0-beta.6

Reproduction link

https://github.com/ChristianMurphy/reproduce-vue-issue

Steps to reproduce

vue create example-component
# select default
cd example-component
npm run build -- --target wc --name example-component

What is expected?

Registered custom element name should match --name option

window.customElements.define('example-component', vue_wc_wrapper(external__Vue__default.a, src_App))

What is actually happening?

Registered custom element name is app

window.customElements.define('app', vue_wc_wrapper(external__Vue__default.a, src_App))
@dhensche
Copy link
Contributor

dhensche commented Apr 27, 2018

unless I am mistaken, it looks like I may have encountered a different bug trying to fix this issue. I am unable to build multiple files at once for web components as my entry glob is expanded too early and then only one entry point is passed down to resolveWcConfig.js (instead of the file glob that should be used to find all components I want to build)

edit: nevermind, I can prevent the glob expansion by putting my entry in quotes --

--entry "TestComponent*" instead of --entry TestComponent* so that the terminal doesn't automatically expand the pattern

dhensche pushed a commit to dhensche/vue-cli that referenced this issue Apr 27, 2018
…ixes vuejs#1146)

Fixes issue that prevented single entry wc builds from honoring the `--name` argument.
The build process would just use the entry file name for the component name when registering the component previously
dhensche pushed a commit to dhensche/vue-cli that referenced this issue Apr 27, 2018
…ixes vuejs#1146)

Fixes issue that prevented single entry wc builds from honoring the `--name` argument.
The build process would just use the entry file name for the component name when registering the component previously
yyx990803 pushed a commit that referenced this issue Apr 27, 2018
…1182)

Fixes issue that prevented single entry wc builds from honoring the `--name` argument.

fix #1146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants