|
8 | 8 | "module": "esm/index.js",
|
9 | 9 | "types": "index.d.ts",
|
10 | 10 | "scripts": {
|
11 |
| - "add-domdiff": "echo '/* AUTOMATICALLY IMPORTED, DO NOT MODIFY */' > esm/shared/domdiff.js && cat node_modules/domdiff/esm/index.js >> esm/shared/domdiff.js", |
12 |
| - "build": "npm run cjs && npm run max && npm run min && npm run ie && npm run umd && npm test && npm run size", |
13 |
| - "cleanup": "bash -c \"echo \\\"\\$(cat index.js | sed 's/(exports)/(global)/' | sed 's/return exports;/return hyper;/' | sed -e 's/exports.*;//g' | sed 's/({})/(window)/')\\\" > index.js\"", |
14 |
| - "cjs": "npm run add-domdiff && ascjs ./esm ./cjs", |
| 11 | + "$": "npm-dollar", |
| 12 | + "build": "npm run $ build", |
| 13 | + "bundle": "npm run $ bundle", |
15 | 14 | "coveralls": "cat ./coverage/lcov.info | coveralls",
|
16 |
| - "ie": "babel ./test/test.js --out-dir ./test/ie --plugins=$(node -e 'console.log([\"transform-es2015-classes\", \"transform-es2015-template-literals\"].concat(require(\"./babel-plugins.json\")).join(\",\"))')", |
17 |
| - "max": "rollup --config rollup.config.js && npm run cleanup", |
18 |
| - "min": "bash -c 'echo \"/*! (c) Andrea Giammarchi (ISC) */$(uglifyjs index.js --support-ie8 --comments=/^!/ -c -m)\" > min.js'", |
19 |
| - "umd": "echo \"(function(A,G){if(typeof define=='function'&&define.amd)define([],G);else if(typeof module=='object'&&module.exports)module.exports=G();else A.hyperHTML=G()}(typeof self!='undefined'?self:this,function(){\">umd.js;cat min.js>>umd.js;echo \"return hyperHTML}));\">>umd.js", |
20 |
| - "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c", |
21 |
| - "brotli": "cat min.js | bro | wc -c", |
22 |
| - "test": "cp index.js index.c.js && echo 'module.exports = hyperHTML;' >> index.c.js && istanbul cover test/runner.js && rm index.c.js", |
23 |
| - "postinstall": "lightercollective" |
| 15 | + "postinstall": "lightercollective", |
| 16 | + "test": "npm run $ test" |
| 17 | + }, |
| 18 | + "$": { |
| 19 | + "bundle": { |
| 20 | + "max": [ |
| 21 | + "rollup --config rollup.config.js", |
| 22 | + "$ cleanup" |
| 23 | + ], |
| 24 | + "min": [ |
| 25 | + [ |
| 26 | + "echo \"/*! (c) Andrea Giammarchi (ISC) */$(", |
| 27 | + "uglifyjs index.js --support-ie8 --comments=/^!/ -c -m", |
| 28 | + ")\" > min.js" |
| 29 | + ] |
| 30 | + ], |
| 31 | + "ie": [ |
| 32 | + [ |
| 33 | + "babel ./test/test.js --out-dir ./test/ie --plugins=$(", |
| 34 | + "node -e 'console.log([\"transform-es2015-classes\", \"transform-es2015-template-literals\"].concat(require(\"./babel-plugins.json\")).join(\",\")", |
| 35 | + ")')" |
| 36 | + ] |
| 37 | + ], |
| 38 | + "umd": [ |
| 39 | + [ |
| 40 | + "echo \"(function(A,G){if(typeof define=='function'&&define.amd)define([],G);else", |
| 41 | + "if(typeof module=='object'&&module.exports)module.exports=G();else", |
| 42 | + "A.hyperHTML=G()}(typeof self!='undefined'?self:this,function(){\">umd.js;cat", |
| 43 | + "min.js>>umd.js;echo \"return hyperHTML}));\">>umd.js" |
| 44 | + ] |
| 45 | + ] |
| 46 | + }, |
| 47 | + "build": [ |
| 48 | + "$ cjs", |
| 49 | + "$ bundle.max", |
| 50 | + "$ bundle.min", |
| 51 | + "$ bundle.ie", |
| 52 | + "$ bundle.umd", |
| 53 | + "$ test", |
| 54 | + "$ size" |
| 55 | + ], |
| 56 | + "cleanup": [ |
| 57 | + [ |
| 58 | + "cat index.js |", |
| 59 | + "sed 's/(exports)/(global)/' |", |
| 60 | + "sed 's/return exports;/return hyper;/' |", |
| 61 | + "sed -e 's/exports.*;//g' |", |
| 62 | + "sed 's/({})/(window)/' > index.clean" |
| 63 | + ], |
| 64 | + "mv index.clean index.js" |
| 65 | + ], |
| 66 | + "cjs": [ |
| 67 | + "$ domdiff", |
| 68 | + "ascjs ./esm ./cjs" |
| 69 | + ], |
| 70 | + "domdiff": [ |
| 71 | + "echo '/* AUTOMATICALLY IMPORTED, DO NOT MODIFY */' > esm/shared/domdiff.js", |
| 72 | + "cat node_modules/domdiff/esm/index.js >> esm/shared/domdiff.js" |
| 73 | + ], |
| 74 | + "size": { |
| 75 | + "gzip": [ |
| 76 | + [ |
| 77 | + "cat index.js |", |
| 78 | + "wc -c;cat min.js |", |
| 79 | + "wc -c;gzip -c9 min.js |", |
| 80 | + "wc -c" |
| 81 | + ] |
| 82 | + ], |
| 83 | + "brotli": "cat min.js | brotli | wc -c" |
| 84 | + }, |
| 85 | + "test": [ |
| 86 | + "cp index.js index.c.js", |
| 87 | + "echo 'module.exports = hyperHTML;' >> index.c.js", |
| 88 | + "istanbul cover test/runner.js", |
| 89 | + "rm index.c.js" |
| 90 | + ] |
24 | 91 | },
|
25 | 92 | "repository": {
|
26 | 93 | "type": "git",
|
|
64 | 131 | "coveralls": "^3.0.0",
|
65 | 132 | "domdiff": "^0.4.0",
|
66 | 133 | "istanbul": "^0.4.5",
|
| 134 | + "npm-dollar": "^0.1.1", |
67 | 135 | "rollup": "^0.60.0",
|
68 | 136 | "rollup-plugin-babel": "^3.0.2",
|
69 | 137 | "tressa": "^0.3.1",
|
|
0 commit comments