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

Why is there no src folder in the npm install package? #44

Closed
flex79 opened this issue Nov 20, 2018 · 6 comments
Closed

Why is there no src folder in the npm install package? #44

flex79 opened this issue Nov 20, 2018 · 6 comments
Labels

Comments

@flex79
Copy link

flex79 commented Nov 20, 2018

When i install the package I only get the dist folder. Can u include the src and also update package.json to use the src instead of the dist? Dist file contains all kind of local build references, feels kinda dirty to use this. Also it might not match my projects build browser targets.

@apertureless
Copy link
Owner

Hi @flex79

well, the src is not included, because it is common practice to only distribute the builded dist files.

If you take a look at other libs, like vue itself, it also only distribute the builded files.

It does not make any sense to include the src to the npm package and point it as an entry. Because then no one could use it, without installing all the dev dependencies to their local project. I make use of a lot of es6 featues. So you had to install babel to your project with the presets in order to transpile it. Which is a lot of overhead for the most users.

The build output is a UMD file, which will work on the client side and on the server side. It will work in every build environment (webpack, browserify) and also directly added to the browser over <script> tag.

If you have specific older browser support, you can add the node_modules or the package to the includes of your babel-loader and it should run over it.

@flex79
Copy link
Author

flex79 commented Nov 20, 2018

Ok thanks. I did check some of my other packages they do all have the src included but use the dist version in it's package. I guess thats fine then, however in your build stuff like this:

"Component.options.__file = "/Users/jjuszczak/Projekte/Privat/vue-cookie-law/src/components/CookieLaw.vue" feels wrong

@apertureless
Copy link
Owner

Oh, thats interesting.
I will check out the output and see whats exactly happening there.

It is not happening in other packages like https://github.com/apertureless/vue-chartjs/blob/develop/dist/vue-chartjs.js

@apertureless
Copy link
Owner

May be related to this: vuejs/vue-loader#516

@Saqib-diar
Copy link

hi @apertureless
when i install the package i did not get src folder...!!

@apertureless
Copy link
Owner

Yes. That is right. And that is how it should be. Why do you want the source folder ?

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

No branches or pull requests

3 participants