Upgrade babel 7.

pull/69/head
jaywcjlove 6 years ago
parent e469a29d9c
commit 084ef71c60

@ -1,6 +1,9 @@
{
"presets": [
"env",
"react"
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-transform-runtime"
]
}

15343
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
{
"name": "hotkeys-js",
"description": "A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.",
"version": "3.6.3",
"version": "3.6.4",
"main": "index.js",
"module": "dist/hotkeys.esm.js",
"scripts": {
@ -44,12 +44,13 @@
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/plugin-external-helpers": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"@babel/preset-react": "^7.0.0",
"autoprefixer": "^8.6.1",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"bannerjs": "^1.0.5",
"classnames": "^2.2.5",
"colors-cli": "^1.0.13",
@ -61,20 +62,20 @@
"gh-pages": "^1.2.0",
"highlight.js": "^9.12.0",
"husky": "^1.0.0-rc.8",
"jest": "^22.4.4",
"jest": "^24.7.1",
"less": "^3.0.4",
"parcel-bundler": "^1.12.3",
"parcel-plugin-markdown-string": "^1.3.1",
"parcel-plugin-markdown-string": "^1.3.5",
"postcss-modules": "^1.1.0",
"puppeteer": "^1.14.0",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-markdown": "^3.3.2",
"rimraf": "^2.6.3",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup": "^1.11.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-node-resolve": "^4.2.3",
"uglify-js": "^3.4.0",
"zlib": "^1.0.5"
}

@ -31,7 +31,6 @@ async function build() {
pure_getters: true,
unsafe: true,
unsafe_comps: true,
warnings: false,
},
output: {
ascii_only: true,
@ -48,14 +47,14 @@ async function build() {
banner: banner.multibanner(),
});
const umdMinified = `${banner.onebanner()}\n${uglify.minify(umd.code, uglifyOption).code}`;
const umdMinified = `${banner.onebanner()}\n${uglify.minify(umd.output[0].code, uglifyOption).code}`;
const common = await bundle.generate({
format: 'cjs',
name: 'hotkeys',
banner: banner.multibanner(),
});
const commonMinified = `${banner.onebanner()}\n${uglify.minify(common.code, uglifyOption).code}`;
const commonMinified = `${banner.onebanner()}\n${uglify.minify(common.output[0].code, uglifyOption).code}`;
const es = await bundle.generate({
format: 'es',
@ -63,11 +62,11 @@ async function build() {
banner: banner.multibanner(),
});
write('dist/hotkeys.js', umd.code)
write('dist/hotkeys.js', umd.output[0].code)
.then(() => write('dist/hotkeys.min.js', umdMinified, true))
.then(() => write('dist/hotkeys.common.js', common.code))
.then(() => write('dist/hotkeys.common.js', common.output[0].code))
.then(() => write('dist/hotkeys.common.min.js', commonMinified, true))
.then(() => write('dist/hotkeys.esm.js', es.code));
.then(() => write('dist/hotkeys.esm.js', es.output[0].code));
}
build();
@ -96,5 +95,8 @@ function write(dest, code, zip) {
}
function getSize(code) {
return `${(code.length / 1024).toFixed(2)}kb`;
if (code) {
return `${(code.toString().length / 1024).toFixed(2)}kb`;
}
return '';
}

@ -1,8 +1,12 @@
{
"presets": [
["env", {
"modules": false
}]
[
"@babel/preset-env",
{
"modules": false
}
]
],
"plugins": ["external-helpers"]
"plugins": [
]
}
Loading…
Cancel
Save