-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Update .npmignore to no longer exclude src/ #165
Conversation
What are you referring to? |
This would require you to rely on relative paths to include the source, i.e. However, you/I/someone could just publish |
Do you have experience bundling multiple NPM packages out of the same repository? I'll be glad to setup the scripts for you and send a pull request, but this is an area where I have no experience. If you want something particular done, let me know, otherwise on Monday I'll start looking at what other packages' approaches might be. Also can we call it 'react-es6-css-modules' because conceptually the difference is "css modules" vs "es6 css modules"? |
What I don't understand is – suppose we distribute the |
I just use the same babel-loader as the rest of my files:
Since you are also omitting your .babelrc from the distribution folder, my babel transform picks them up. |
Alternatively, you could bundle files with a separate babel transform chain for es6 module based projects, like |
The fact that it is working, is coincidental. This is not a reliable way to import/ use a dependency. |
As long as there's no .babelrc, the module resolver will resolve 'react-css-modules' as the installed version at node_modules, so |
What happens when I (as an example) add Flow types to the codebase? Your build breaks. Maybe I am misunderstanding the proposal. Are you suggesting to distribute the source code as it is, or are you suggesting to distribute a source code that omits the |
I get what you're saying, but it's a risk I'm willing to take. The specific transform that's breaking for me is (I think) I don't think the additional cost of a few extra KB of download per npm install is really a reason not to distribute the source folder. If you don't want to offer support for people doing crazy things like this, I get it, but why not just let me get at the source folder at my own risk? If you're dead set against it, I can setup a separate distributed 'es6' file the same way that react-router does, but that seems like an awful lot of work, since the primary benefit of distributing things that way is bundle size. |
A story of how
Given this unique requirement, why not simply: git clone [email protected]:gajus/react-css-modules.git
cd ./react-css-modules
npm link and you are set to use Sure, this would mean needing to pull the latest changes every time a new version is released. However, as you said, this is used only for an esoteric use case and only for development purposes. |
These are all risks I'm willing to take. It seems like you're trying to protect me from myself, which I don't think is necessary. I don't want to rely on git versions because it makes shrinkwrapping a bit more difficult. We could state this issue a different way: I want to use react-css-modules with only the The easiest fix (for now) is to just distribute the src/ folder as is, and let the esoteric users figure it out. When (as I believe will be sooner rather than later) the JS community writes tools like UglifyJS that work with ES6, I think this sort of requirement will move from esoteric into common place. |
You don't rely on git versions. You'd be using this only for development, as you have said.
You can, just branch out and release a package that supports only the modern browsers. It is a valid request, just not popular enough to be included in the main repository.
And then it will be included in the main package. |
This is starting to go roundabout. To summarise:
|
Thank you for the PR. |
I do have to. What your suggesting requires me to keep track of what git version corresponds to what NPM version and keep the two in lock step. I don't want to sound rude, but all of your suggestions incur a significant time and technical cost on my part, and the only argument against including the source folder is NPM distribution size when I've already provided a pull request. Not including the source folder in NPM distribution isn't even considered best practice, so why are you so dead set against it? I don't understand your apprehension in including the source folder at all. Does saving 36K per download really justify risking alienating your users or a fork? There's literally zero cost to you to merge this pull request and you're denying it... why? |
If you try to use react-css-modules with the babel-modern preset, one of the transforms used in the distribution process is incompatible.
This is probably an edge case, but I want to include the source directly, let my babel loader know about it, and then use the babel-modern preset.
Can you start distributing the source folder in npm packages please? Thanks!