Add npm and minified builds

This commit is contained in:
MoyuScript
2017-12-03 17:07:10 +08:00
parent af4007effc
commit 88d50b107b
6 changed files with 80 additions and 66 deletions

View File

@@ -2,7 +2,7 @@
"title": "html2canvas",
"name": "html2canvas",
"description": "Screenshots with JavaScript",
"main": "dist/html2canvas.js",
"main": "dist/npm/index.js",
"version": "1.0.0-alpha.1",
"author": {
"name": "Niklas von Hertzen",
@@ -24,6 +24,8 @@
"babel-core": "6.25.0",
"babel-eslint": "7.2.3",
"babel-loader": "7.1.1",
"babel-plugin-dev-expression": "0.2.1",
"babel-plugin-transform-es2015-modules-commonjs": "6.26.0",
"babel-plugin-transform-object-rest-spread": "6.23.0",
"babel-preset-es2015": "6.24.1",
"babel-preset-flow": "6.23.0",
@@ -52,22 +54,26 @@
"platform": "1.3.4",
"prettier": "1.5.3",
"promise-polyfill": "6.0.2",
"replace-in-file": "^3.0.0",
"rimraf": "2.6.1",
"serve-index": "1.9.0",
"slash": "1.0.0",
"uglifyjs-webpack-plugin": "^1.1.2",
"webpack": "3.4.1"
},
"scripts": {
"build": "rimraf dist/ && node scripts/create-reftest-list && npm run build:npm && npm run build:browser",
"build:npm": "babel src/ -d dist/npm/",
"build:npm": "babel src/ -d dist/npm/ --plugins=dev-expression,transform-es2015-modules-commonjs && replace-in-file __VERSION__ '$npm_package_version' dist/npm/index.js",
"build:browser": "webpack",
"format": "prettier --single-quote --no-bracket-spacing --tab-width 4 --print-width 100 --write \"{src,tests,scripts}/**/*.js\"",
"flow": "flow",
"lint": "eslint src/**",
"test": "npm run flow && npm run lint && npm run karma",
"test": "npm run flow && npm run lint && npm run test:node && npm run karma",
"test:node": "mocha tests/node/*.js",
"karma": "node karma",
"watch": "webpack --progress --colors --watch",
"start": "node tests/server"
"start": "node tests/server",
"ss": "node $npm_package_version"
},
"homepage": "https://html2canvas.hertzen.com",
"license": "MIT",