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
Added standalone build #80
Conversation
}), | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify('production') | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this part really necessary? Is NODE_ENV used?
Thanks @MoOx 👌 |
Btw I think you wanted to poke @sindresorhus, not @sindersorhus :D |
sigh I always do that. |
Big 👎 This is not something each module should have to do. Use a bundler like Webpack or Browserify yourself. Alternatively, instead of npmcdn, use this: https://github.com/sindresorhus/awesome-npm#standalone-version-of-a-package. Or better yet, request npmcdn do the same thing. |
I have to admit that I am really surprised that npmcdn does not "standalonify" module. It's completely useless this way :'( |
My 2 cents: -1 too for a standalone build in this module. |
Thanks for the reviews, gents. Going to have to go with them on this. Thanks for the PR, though! :) |
While I agree that in a perfect world there should be no need for a build, I just want to point out my reason for making this PR: when I've discovered this lib and wanted to try it in codepen etc. I discovered that there is no way to do that. The general purpose for making a library is to make someone's else live easier and, obviously, having a standalone build will make someone's live easier even thought it's kind of a work around a non-perfect world. Thanks for your interest and responses, anyways. |
Hi! I want this lib to be accessible via just a script tag so I've added a webpack-build. I haven't changed where the 'main' is pointing out, so
require('color')
will still be delivering index.js from the root of the package, but at the same time one would be able to access the lib viahttps://npmcdn.com/color/standalone_dist/color.min.js
(and also via cdnjs, cdnjs/cdnjs#6800).