0

我想将我的src文件夹编译到我的build文件夹中,但gulp-babel没有创建任何文件,也没有看到任何错误。

gulp.task('build', () => {
  gulp
    .src(['./src/**/*.js'])
    .pipe(
      babel({
        presets: ['@babel/preset-env']
      })
    )
    .pipe(gulp.dest('build/'))
})

日志:

[10:52:18] Starting 'build'...
[10:52:18] Finished 'build' after 5.85 ms

我的 SCSS 文件有一个类似的源和目标,它运行良好,所以据我所知,这不是路径问题。

包.json

"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.6",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-decorators": "^7.1.6",
"@babel/plugin-proposal-do-expressions": "^7.0.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-function-sent": "^7.1.0",
"@babel/plugin-proposal-json-strings": "^7.0.0",
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/preset-env": "^7.1.6",
"@babel/preset-typescript": "^7.1.0",
"@babel/traverse": "^7.1.4",
"eslint": "^5.0.1",
"eslint-config-prettier": "^3.1.0",
"eslint-loader": "^2.0.0",
"eslint-plugin-prettier": "^3.0.0",
"eslint-plugin-security": "^1.4.0",
"gulp": "^3.9.1",
"gulp-babel": "^8.0.0",
"gulp-nodemon": "^2.4.1",
"gulp-sass": "^4.0.2",
"node-sass": "^4.10.0",
"nodemon": "^1.11.0",
"typescript-eslint-parser": "^21.0.0",
4

0 回答 0