Skip to content

Commit

Permalink
perf(core): Optimize babel configuration & removing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Marinerer committed Oct 15, 2023
1 parent 6dfda6a commit c0ed8e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
11 changes: 2 additions & 9 deletions packages/core/build/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const babel = require('gulp-babel')
const concat = require('gulp-concat')
const replace = require('gulp-replace')
const uglifyjs = require('gulp-terser')
Expand Down Expand Up @@ -32,7 +31,6 @@ function compileScript(options = {}, done) {
const {
input,
alias,
compiler,
minify: jsMinify
} = options

Expand Down Expand Up @@ -71,12 +69,7 @@ function compileScript(options = {}, done) {
// 6. 自定义处理流程
putProcesses(processes, options.plugins)

// 7. babel转换 //!需配置 `babel.config.json`
if (compiler === 'babel') {
processes.push(babel())
}

// 6. 压缩处理
// 7. 压缩处理
if (jsMinify) {
const minifyOptions = _.isPlainObject(jsMinify) ? jsMinify : {}
processes.push(uglifyjs(minifyOptions))
Expand Down Expand Up @@ -119,7 +112,7 @@ function compileScript(options = {}, done) {

const compileModuleScript = require('./script.module')
module.exports = function scriptTask(options = {}, done) {
if (options.module) {
if (options.compiler) {
return compileModuleScript(options, done)
} else {
return compileScript(options, done)
Expand Down
4 changes: 0 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,10 @@
"url": "https://github.com/Meqn/pipflow/issues"
},
"dependencies": {
"@babel/core": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"@pipflow/utils": "workspace:^",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
"cssnano": "^6.0.1",
"gulp-art-tpl": "^1.3.0",
"gulp-babel": "^8.0.0",
"gulp-concat": "^2.6.1",
"gulp-ejs": "^5.1.0",
"gulp-env-loader": "^1.1.1",
Expand Down

0 comments on commit c0ed8e0

Please sign in to comment.