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

Added standalone build #80

Closed
wants to merge 2 commits into from
Closed

Added standalone build #80

wants to merge 2 commits into from

Conversation

aush
Copy link

@aush aush commented Feb 4, 2016

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 via https://npmcdn.com/color/standalone_dist/color.min.js (and also via cdnjs, cdnjs/cdnjs#6800).

}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
Copy link
Collaborator

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?

@Qix-
Copy link
Owner

Qix- commented Feb 5, 2016

Thanks @MoOx 👌

@MoOx
Copy link
Collaborator

MoOx commented Feb 5, 2016

Btw I think you wanted to poke @sindresorhus, not @sindersorhus :D

@Qix-
Copy link
Owner

Qix- commented Feb 5, 2016

sigh I always do that.

@sindresorhus
Copy link
Sponsor

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.

@MoOx
Copy link
Collaborator

MoOx commented Feb 5, 2016

I have to admit that I am really surprised that npmcdn does not "standalonify" module. It's completely useless this way :'(

@MoOx
Copy link
Collaborator

MoOx commented Feb 5, 2016

My 2 cents: -1 too for a standalone build in this module.

@Qix-
Copy link
Owner

Qix- commented Feb 5, 2016

Thanks for the reviews, gents. Going to have to go with them on this.

Thanks for the PR, though! :)

@Qix- Qix- closed this Feb 5, 2016
@aush
Copy link
Author

aush commented Feb 5, 2016

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.

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

Successfully merging this pull request may close these issues.

None yet

4 participants