UMD option for publishing to NPM?
See original GitHub issueI have been looking at a couple repositories for a neat starter project for publishing a collection of Vue components or a small library for Vue.js.
So far what I’ve seen is that they are either too simplistic or made by people who do not really understand what is going on with Webpack.
This template seems to fit the bill though, having HMR, different Webpack setups per environment, a linter, unit testing, e2e testing, etc.
I was kind of surprised to see there is no way to neatly publish a library with this template though. Is this conscious a choice or has this just never been added?
I would love a Webpack config for publishing to NPM with externals
options libraryTarget
, etc.
At the moment I am trying to figure this out all on my own so I at least have an understanding of what is going on but this is taking quite some time to figure out. It would be nice to have a community effort for something like this and although I am willing to help, I am no expert on this(yet 😛).
Thoughts?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
It would be nice and useful to have an official template for plugins. I think the demand will increase because the vue community is growing and also is maturing. For instance, I’m not a pro dev, but recently I 've realized that I need a clear way to create a plugin in order to share what I have learnt. I will try to use one of the templates you suggested above and see what happens, but maybe it is possible to redistribute some resources to prioritize that. I mean as you told there are core team members thats have already their own templates. It is just a wish, you guys are doing awesome things with Vue
We are aware that there’s a need for a template for developing components/packages/plugins as opposed to a full app.
This template is meant for the latter. I don’t think it makes sense to try and turn it into a template that can also create plugins/packages, because it’s not just about some webpack options.
Ideally, you don’t use webpack to bundle packages for production, but rollup, because the runtime overhead of webpack increases the size disroportionally for small libs.
Also, ideally you build more than one version for production, at least:
As you can see, a proper template for this will work quite a bit differently, so it should be done in a different template alltogether, instead of shoehorning it into this one.
About the question weither we are working on this: Yes and no.
Available templates: