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

Getting error trying to build library of components #965

Closed
jineshshah36 opened this issue Mar 9, 2018 · 6 comments
Closed

Getting error trying to build library of components #965

jineshshah36 opened this issue Mar 9, 2018 · 6 comments

Comments

@jineshshah36
Copy link
Contributor

Version

3.0.0-beta.6

Reproduction link

https://github.com/jineshshah36/vue-test-lib

Steps to reproduce

clone repo, run yarn, run yarn run build.

What is expected?

Build should create a lib of components

What is actually happening?

Build will fail

@LinusBorg
Copy link
Member

LinusBorg commented Mar 12, 2018

Would it be possible to share the error in the issue description so we might get a first idea whats happening before we clone the reporduction repository (thanks for setting that up btw)?

@DanielPe05
Copy link

DanielPe05 commented Mar 14, 2018

@jineshshah36 I think you are only missing the entry point of your components in your build script. Something like this: vue-cli-service build --dest lib --target lib src/main.js. This should give you a little more context: https://github.com/vuejs/vue-cli/blob/dev/docs/build-targets.md#library

@jineshshah36
Copy link
Contributor Author

You are correct, but actually in the process, I have uncovered a new bug If you clone the repo and yarn run build you'll see that it does build but because I had a dash in the name, it spits out. It should probably camelcase the name?

<script src="https://unpkg.com/vue"></script>
<script src="./joinarthur-components.umd.js"></script>
<link rel="stylesheet" href="./joinarthur-components.css">

<div id="app">
  <demo></demo>
</div>

<script>
new Vue({
  components: {
    demo: joinarthur-components
  }
}).$mount('#app')
</script>

@johnwebbcole
Copy link

I'm seeing this with a scoped package as well. Is there a way to set the name in the umd.js besides project name?

@johnwebbcole
Copy link

I've created issue #1064 and a sample repo for the scoped library issue. Maybe someone will be able to show me what I've done wrong :-)

@yyx990803
Copy link
Member

Closing as the original repro seems no longer available.

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

No branches or pull requests

5 participants