実現したいこと
gulpでbabelを動かしてES5準拠のjsを出力したいと思っています。
プリセットの読み込み?でエラーになってコンパイルがされません。
発生している問題・エラーメッセージ
[Error running Gulp] Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/beeworks/htdocs/******/node_modules/babel-preset-es2015/lib/index.js
.babelrc
{ "presets": ["es2015"] }
gulpfile.js
gulp.task("js", function() { gulp.src(["js-origin/*.js"]) .pipe(plumber({ errorHandler: notify.onError("Error: <%= error.message %>") })) .pipe(babel()) .pipe(gulp.dest("js/")) .pipe(notify('js task finished')); });
packagge.json
"devDependencies": { "@babel/core": "^7.0.0", "ajv": "^6.5.3", "babel-cli": "^6.26.0", "babel-core": "^6.26.3", "babel-loader": "^8.0.0", "babel-preset-env": "^1.7.0", "babel-preset-es2015": "^6.24.1", "babel-preset-stage-0": "^6.24.1", "gulp": "^3.9.1", "gulp-babel": "^8.0.0", 略
試したこと
.babelrcを削除すると問題なく動きます。(コンパイルはされずコピーされるだけ)
envを使うと
[Error running Gulp] Error: Cannot read property 'bindings' of null
になります。
昨日からずっとgulpと戦っていますがなかなか進展せず疲れました・・・
webpackでも同様のことが起きてここにたどり着きました・・
あなたの回答
tips
プレビュー