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

feat: Add CommonJS, AMD, and ES6 module support #161

Merged
merged 2 commits into from
Jul 15, 2019
Merged

Conversation

lokesh
Copy link
Owner

@lokesh lokesh commented Jul 15, 2019

New files in the /dist folder

  • /dist/color-thief.umd.js: UMD module. For simple script tag loading that exposes a global variable or for RequireJS AMD support.
  • /dist/color-thief.js: CommonJS module. Entry point for Node.js and Browserify. (Note: The script does not run in a Node env, though this is next on the roadmap. For now, you can evaluate this fork )
  • /dist/color-thief.mjs: ES6 module. For modern browsers as well as Webpack and Rollup.
  • /dist/color-thief.min.js: Duplicate of /dist/color-thief.umd.js. Kept around to maintain backwards compatibility.

Additional changes

  • Replace uglify with microbundle for build step
  • Add test for es6 module loading
  • Bump minor version to v2.2.0

cc: @huw30 👋

lokesh added 2 commits July 14, 2019 10:12
- `/dist/color-thief.umd.js`: UMD module. For simple script tag loading that exposes a global variable or for RequireJS AMD support.
- `/dist/color-thief.js`: CommonJS module. Entry point for Node.js and Browserify.
- `/dist/color-thief.mjs`: ES6 module. For modern browsers as well as Webpack and Rollup.
- `/dist/color-thief.min.js`: Duplicate of `/dist/color-thief.umd.js`. Kept around to maintain backwards compatibility.
@lokesh lokesh merged commit 0d60456 into master Jul 15, 2019
@lokesh lokesh deleted the add-module-support branch July 15, 2019 03:07
@huw30
Copy link

huw30 commented Jul 16, 2019

Thank you @lokesh

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.

2 participants