mirror of https://github.com/twbs/bootstrap.git
Babel 7 (#23966)
* use .babelrc.js, compile bundled/non-bundled with loose mode * add back helper, exclude typeof transform
This commit is contained in:
parent
5cec8e0de6
commit
f17b165f0f
12
.babelrc
12
.babelrc
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"es2015",
|
|
||||||
{
|
|
||||||
"loose": true,
|
|
||||||
"modules": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"plugins": ["external-helpers"]
|
|
||||||
}
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
'env',
|
||||||
|
{
|
||||||
|
loose: true,
|
||||||
|
modules: false,
|
||||||
|
exclude: ['transform-es2015-typeof-symbol']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
process.env.ROLLUP && 'external-helpers',
|
||||||
|
process.env.PLUGINS && 'transform-es2015-modules-strip',
|
||||||
|
].filter(Boolean)
|
||||||
|
};
|
|
@ -11,11 +11,9 @@ const plugins = [
|
||||||
babel({
|
babel({
|
||||||
exclude: 'node_modules/**', // only transpile our source code
|
exclude: 'node_modules/**', // only transpile our source code
|
||||||
externalHelpersWhitelist: [ // include only required helpers
|
externalHelpersWhitelist: [ // include only required helpers
|
||||||
'typeof',
|
'defineProperties',
|
||||||
'classCallCheck',
|
|
||||||
'createClass',
|
'createClass',
|
||||||
'inherits',
|
'inheritsLoose'
|
||||||
'possibleConstructorReturn'
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
|
@ -33,9 +33,9 @@
|
||||||
"js-lint": "eslint js/ && eslint --config js/tests/.eslintrc.json --env node build/ Gruntfile.js",
|
"js-lint": "eslint js/ && eslint --config js/tests/.eslintrc.json --env node build/ Gruntfile.js",
|
||||||
"js-lint-docs": "eslint --config js/tests/.eslintrc.json assets/js/ sw.js",
|
"js-lint-docs": "eslint --config js/tests/.eslintrc.json assets/js/ sw.js",
|
||||||
"js-compile": "npm-run-all --parallel js-compile-*",
|
"js-compile": "npm-run-all --parallel js-compile-*",
|
||||||
"js-compile-standalone": "rollup --environment BUNDLE:false --config build/rollup.config.js",
|
"js-compile-standalone": "ROLLUP=true rollup --environment BUNDLE:false --config build/rollup.config.js",
|
||||||
"js-compile-bundle": "rollup --environment BUNDLE:true --config build/rollup.config.js",
|
"js-compile-bundle": "ROLLUP=true rollup --environment BUNDLE:true --config build/rollup.config.js",
|
||||||
"js-compile-plugins": "babel --no-babelrc js/src/ --out-dir js/dist/ --source-maps --presets=es2015 --plugins=transform-es2015-modules-strip",
|
"js-compile-plugins": "PLUGINS=true babel js/src/ --out-dir js/dist/ --source-maps",
|
||||||
"js-minify": "npm-run-all --parallel js-minify-standalone js-minify-bundle",
|
"js-minify": "npm-run-all --parallel js-minify-standalone js-minify-bundle",
|
||||||
"js-minify-standalone": "uglifyjs --config-file build/uglifyjs.config.json --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
|
"js-minify-standalone": "uglifyjs --config-file build/uglifyjs.config.json --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
|
||||||
"js-minify-bundle": "uglifyjs --config-file build/uglifyjs.config.json --output dist/js/bootstrap.bundle.min.js dist/js/bootstrap.bundle.js",
|
"js-minify-bundle": "uglifyjs --config-file build/uglifyjs.config.json --output dist/js/bootstrap.bundle.min.js dist/js/bootstrap.bundle.js",
|
||||||
|
@ -76,11 +76,11 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^7.1.2",
|
"autoprefixer": "^7.1.2",
|
||||||
"babel-cli": "^6.24.1",
|
"babel-cli": "7.0.0-beta.0",
|
||||||
"babel-eslint": "^8.0.0",
|
"babel-eslint": "^8.0.0",
|
||||||
"babel-plugin-external-helpers": "^6.22.0",
|
"babel-plugin-external-helpers": "7.0.0-beta.0",
|
||||||
"babel-plugin-transform-es2015-modules-strip": "^0.1.1",
|
"babel-plugin-transform-es2015-modules-strip": "^0.1.1",
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"babel-preset-env": "2.0.0-beta.0",
|
||||||
"clean-css-cli": "^4.1.6",
|
"clean-css-cli": "^4.1.6",
|
||||||
"eslint": "^4.2.0",
|
"eslint": "^4.2.0",
|
||||||
"grunt": "^1.0.1",
|
"grunt": "^1.0.1",
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
"postcss-cli": "^4.1.0",
|
"postcss-cli": "^4.1.0",
|
||||||
"qunit-phantomjs-runner": "^2.3.0",
|
"qunit-phantomjs-runner": "^2.3.0",
|
||||||
"qunitjs": "^2.4.0",
|
"qunitjs": "^2.4.0",
|
||||||
"rollup": "^0.49.2",
|
"rollup": "^0.50.0",
|
||||||
"rollup-plugin-babel": "^3.0.2",
|
"rollup-plugin-babel": "^3.0.2",
|
||||||
"rollup-plugin-node-resolve": "^3.0.0",
|
"rollup-plugin-node-resolve": "^3.0.0",
|
||||||
"shelljs": "^0.7.8",
|
"shelljs": "^0.7.8",
|
||||||
|
|
Loading…
Reference in New Issue