话不多说,适配了半天终于找到几个能用的插件了。
这是pack.json文件。目前能兼容es6
{
"name": "gulp-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"gulp": "^4.0.2",
"gulp-babel": "^7.0.1",
"gulp-clean-css": "^4.2.0",
"gulp-htmlmin": "^5.0.1",
"gulp-imagemin": "^5.0.3",
"gulp-uglify": "^3.0.2"
}
}
目前用的gulp4,task里面要加done(),执行方法里加同步(异步)操作