正如标题所说,babel--out-file-extension
不起作用。
这里是package.json
:
{
"name": "Assets",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"babel:dev": "babel --presets es2015 Scripts/src -d Scripts/js",
"babel:min": "babel --presets minify Scripts/src -d Scripts/js --out-file-extension .min.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-preset-es2015": "^6.24.1",
"babel-preset-minify": "^0.5.1"
}
}
当我运行npm run babel:dev
结果是:Scripts\src\main.js -> Scripts\js\main.js
但是当我运行时会发生相同的结果npm run babel:min
,输出文件被缩小但扩展名不会改变。
那么我在这里做错了什么?