Skip to content

Commit

Permalink
add: @babel/preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchen915 committed Oct 30, 2020
1 parent b11de26 commit 845c6c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
19 changes: 13 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ const babelConfig = {
plugins: [
],
presets: [
'@babel/preset-env'
['@babel/preset-env', {
useBuiltIns: 'usage',
corejs: 3,
targets: {
chrome: 58,
ie: 11
}
}]
]
};

Expand All @@ -68,7 +75,7 @@ const paths = {
destStaticCssImages: ['dist/css'],

//core es module
core: ['src/**/*.js','!src/demoData/*.js','src/expendPlugins/**/plugin.js','!src/plugins/js/*.js'],
core: ['src/**/*.js','!src/demoData/*.js','src/expendPlugins/**/plugin.js','!src/plugins/js/*.js'],

//plugins src
pluginsCss: ['src/plugins/css/*.css'],
Expand Down Expand Up @@ -98,7 +105,7 @@ const paths = {
concatPlugins: 'plugins.css',
concatCss: 'luckysheet.css',
concatPluginsJs: 'plugin.js',

//plugins dest
destPluginsCss: ['dist/plugins/css'],
destPlugins: ['dist/plugins'],
Expand Down Expand Up @@ -187,7 +194,7 @@ async function core() {
inlineDynamicImports:true,
});
}

}

// According to the build tag in html, package js and css
Expand All @@ -196,7 +203,7 @@ function pluginsCss() {
.pipe(concat(paths.concatPluginsCss))
.pipe(gulpif(production, cleanCSS()))
.pipe(dest(paths.destPluginsCss))

}

function plugins() {
Expand Down Expand Up @@ -255,4 +262,4 @@ const build = series(clean, parallel(pluginsCss, plugins, css, pluginsJs, copySt

exports.dev = dev;
exports.build = build;
exports.default = dev;
exports.default = dev;
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"browser": "dist/luckysheet.umd.js",
"devDependencies": {
"@babel/preset-env": "^7.10.2",
"@babel/runtime-corejs3": "^7.12.1",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@rollup/plugin-babel": "^5.0.3",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"browser-sync": "^2.26.7",
Expand All @@ -21,12 +22,13 @@
"gulp-if": "^3.0.0",
"gulp-uglify": "^3.0.2",
"gulp-useref": "^4.0.1",
"rollup": "^2.16.1",
"rollup": "^2.32.1",
"rollup-plugin-terser": "^6.1.0",
"standard-version": "^8.0.2",
"vuepress": "^1.5.0"
},
"dependencies": {
"@babel/runtime": "^7.12.1",
"jspdf": "^2.1.1"
},
"scripts": {
Expand Down

0 comments on commit 845c6c3

Please sign in to comment.