fix: upgrade to babel 7; dump uglify for terser; upgrade to jest 24
This commit is contained in:
parent
32835ba047
commit
07f1f9a59c
|
@ -1,24 +1,27 @@
|
|||
{
|
||||
"presets": [
|
||||
[ "env", { "modules": false } ],
|
||||
"stage-0",
|
||||
"flow"
|
||||
[ "@babel/preset-env", { "modules": false } ],
|
||||
"@babel/preset-flow",
|
||||
],
|
||||
|
||||
"plugins": [
|
||||
["module-resolver", {
|
||||
"root": ["./src"],
|
||||
}],
|
||||
"@babel/transform-runtime",
|
||||
"@babel/plugin-proposal-class-properties",
|
||||
"@babel/plugin-proposal-function-bind",
|
||||
],
|
||||
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": [
|
||||
"env",
|
||||
"stage-0",
|
||||
"flow"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"plugins": [
|
||||
["module-resolver", {
|
||||
"root": ["./src"]
|
||||
}],
|
||||
"transform-runtime"
|
||||
]
|
||||
"@babel/transform-runtime",
|
||||
],
|
||||
"presets": [
|
||||
"@babel/preset-env",
|
||||
"@babel/preset-flow",
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -47,7 +47,7 @@
|
|||
"doc": "set -ex; esdoc; node -p '\"\\nDocumentation coverage: \" + require(\"./doc/coverage.json\").coverage'",
|
||||
"doc:watch": "watch 'npm run doc' . --wait=1 --ignoreDirectoryPattern=/doc/",
|
||||
"examples": "set -ex; for example in examples/*.js; do node $example; done",
|
||||
"flow": "set -ex; flow stop; flow-typed install jest@22; flow",
|
||||
"flow": "set -ex; flow stop; flow-typed install jest@24; flow",
|
||||
"flow:stop": "flow stop",
|
||||
"flow:watch": "flow stop; watch 'flow' . --wait=1 --ignoreDirectoryPattern=/doc/",
|
||||
"install": "npm run bpf-sdk:install",
|
||||
|
@ -68,7 +68,7 @@
|
|||
"test:watch": "cross-env NODE_ENV=test jest --watch --useStderr"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-runtime": "^6.26.0",
|
||||
"@babel/runtime": "^7.3.1",
|
||||
"bn.js": "^4.11.8",
|
||||
"bs58": "^4.0.1",
|
||||
"buffer-layout": "^1.2.0",
|
||||
|
@ -82,13 +82,14 @@
|
|||
"ws": "^6.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "6.26.3",
|
||||
"@babel/core": "^7.3.3",
|
||||
"@babel/plugin-proposal-class-properties": "^7.3.3",
|
||||
"@babel/plugin-proposal-function-bind": "^7.2.0",
|
||||
"@babel/plugin-transform-runtime": "^7.2.0",
|
||||
"@babel/preset-env": "^7.3.1",
|
||||
"@babel/preset-flow": "^7.0.0",
|
||||
"babel-eslint": "10.0.1",
|
||||
"babel-plugin-module-resolver": "3.2.0",
|
||||
"babel-plugin-transform-runtime": "^6.23.0",
|
||||
"babel-preset-env": "1.7.0",
|
||||
"babel-preset-flow": "6.23.0",
|
||||
"babel-preset-stage-0": "6.24.1",
|
||||
"codecov": "^3.0.4",
|
||||
"cross-env": "5.2.0",
|
||||
"elfy": "^0.1.0",
|
||||
|
@ -106,19 +107,19 @@
|
|||
"flow-bin": "0.93.0",
|
||||
"flow-typed": "2.5.1",
|
||||
"fs-file-tree": "1.0.7",
|
||||
"jest": "23.6.0",
|
||||
"jest": "24.1.0",
|
||||
"marked": "^0.6.0",
|
||||
"prettier": "^1.14.3",
|
||||
"rimraf": "2.6.3",
|
||||
"rollup": "1.2.1",
|
||||
"rollup-plugin-babel": "3.0.7",
|
||||
"rollup-plugin-babel": "^4.3.2",
|
||||
"rollup-plugin-commonjs": "9.2.0",
|
||||
"rollup-plugin-json": "^3.0.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
"rollup-plugin-node-globals": "^1.2.1",
|
||||
"rollup-plugin-node-resolve": "4.0.0",
|
||||
"rollup-plugin-replace": "2.1.0",
|
||||
"rollup-plugin-uglify": "3.0.0",
|
||||
"rollup-plugin-terser": "^4.0.4",
|
||||
"semantic-release": "^15.9.16",
|
||||
"watch": "^1.0.2"
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import globals from 'rollup-plugin-node-globals';
|
|||
import json from 'rollup-plugin-json';
|
||||
import nodeResolve from 'rollup-plugin-node-resolve';
|
||||
import replace from 'rollup-plugin-replace';
|
||||
import uglify from 'rollup-plugin-uglify';
|
||||
import {terser} from 'rollup-plugin-terser';
|
||||
|
||||
const env = process.env.NODE_ENV;
|
||||
|
||||
|
@ -25,15 +25,6 @@ function generateConfig(configType) {
|
|||
],
|
||||
};
|
||||
|
||||
if (env === 'production') {
|
||||
config.plugins.push(
|
||||
uglify({
|
||||
mangle: false,
|
||||
compress: false,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
switch (configType) {
|
||||
case 'browser':
|
||||
config.output = [
|
||||
|
@ -51,6 +42,17 @@ function generateConfig(configType) {
|
|||
browser: true,
|
||||
}),
|
||||
);
|
||||
|
||||
if (env === 'production') {
|
||||
config.plugins.push(
|
||||
terser({
|
||||
mangle: false,
|
||||
compress: false,
|
||||
sourcemap: true,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
case 'node':
|
||||
config.output = [
|
||||
|
@ -71,21 +73,23 @@ function generateConfig(configType) {
|
|||
// maintained.
|
||||
config.external = [
|
||||
'assert',
|
||||
'babel-runtime/core-js/get-iterator',
|
||||
'babel-runtime/core-js/json/stringify',
|
||||
'babel-runtime/core-js/object/assign',
|
||||
'babel-runtime/core-js/object/get-prototype-of',
|
||||
'babel-runtime/core-js/object/keys',
|
||||
'babel-runtime/core-js/promise',
|
||||
'babel-runtime/helpers/asyncToGenerator',
|
||||
'babel-runtime/helpers/classCallCheck',
|
||||
'babel-runtime/helpers/createClass',
|
||||
'babel-runtime/helpers/get',
|
||||
'babel-runtime/helpers/inherits',
|
||||
'babel-runtime/helpers/possibleConstructorReturn',
|
||||
'babel-runtime/helpers/toConsumableArray',
|
||||
'babel-runtime/helpers/typeof',
|
||||
'babel-runtime/regenerator',
|
||||
'@babel/runtime/core-js/get-iterator',
|
||||
'@babel/runtime/core-js/json/stringify',
|
||||
'@babel/runtime/core-js/object/assign',
|
||||
'@babel/runtime/core-js/object/get-prototype-of',
|
||||
'@babel/runtime/core-js/object/keys',
|
||||
'@babel/runtime/core-js/promise',
|
||||
'@babel/runtime/helpers/asyncToGenerator',
|
||||
'@babel/runtime/helpers/classCallCheck',
|
||||
'@babel/runtime/helpers/createClass',
|
||||
'@babel/runtime/helpers/defineProperty',
|
||||
'@babel/runtime/helpers/get',
|
||||
'@babel/runtime/helpers/getPrototypeOf',
|
||||
'@babel/runtime/helpers/inherits',
|
||||
'@babel/runtime/helpers/possibleConstructorReturn',
|
||||
'@babel/runtime/helpers/toConsumableArray',
|
||||
'@babel/runtime/helpers/typeof',
|
||||
'@babel/runtime/regenerator',
|
||||
'bn.js',
|
||||
'bs58',
|
||||
'buffer-layout',
|
||||
|
|
Loading…
Reference in New Issue