feat: Add module support with new dist files

- `/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.
This commit is contained in:
Lokesh Dhakar
2019-07-14 20:00:27 -07:00
parent 2708113d10
commit c91f3e808e
20 changed files with 5659 additions and 1003 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "colorthief",
"version": "2.1.0",
"version": "2.2.0",
"author": {
"name": "Lokesh Dhakar",
"email": "lokesh.dhakar@gmail.com",
@@ -22,18 +22,23 @@
"url": "https://github.com/lokesh/color-thief.git"
},
"license": "MIT",
"source": "src/color-thief.js",
"main": "dist/color-thief.js",
"module": "dist/color-thief.mjs",
"umd:main": "dist/color-thief.umd.js",
"amdName": "ColorThief",
"scripts": {
"build": "node ./build/build.js",
"build": "microbundle; node ./build/build.js",
"dev": "./node_modules/http-server/bin/http-server",
"test": "./node_modules/.bin/cypress open"
},
"main": "dist/color-thief.min.js",
"devDependencies": {
"@node-minify/core": "^4.0.5",
"@node-minify/uglify-es": "^4.0.5",
"cypress": "^3.4.0",
"eslint": "^5.16.0",
"http-server": "^0.11.1",
"microbundle": "^0.11.0",
"mustache": "^3.0.1"
},
"engines": {