Я заменил uglify на babel (и concat), поэтому я объединяю несколько файлов ES6 в один дистрибутивный файл JS.Я бы хотел конкатить в папку dist и сделать так, чтобы babel перенес и перезаписал файл, но при этом babel не может использовать dist FOLDER, предупреждение: не удалось найти предустановленный «env» относительно каталога
Что я делаю не так?
мой Gruntfile.js:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
/*sourceMap: true,
sourceMapStyle: "link"*/
},
dist: {
src: [
"js/file1.js",
"js/file2.js",
"js/file3.js",
"js/file4.js",
"js/file5.js"
],
dest: "js/script.concat.js"
}
},
babel: {
options: {
presets: ["env"],
/*sourceMap: true,*/
minified: true
},
dist: {
files: [{"../dist/js/script.min.js" : "js/script.concat.js"}]
}
},
watch: {
js: {
files: ["js/file1.js", "js/file2.js", "js/file3.js", "js/file4.js", "js/file5.js"],
tasks: ["concat:dist", "babel:dist"]
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['concat:dist', 'babel:dist']);
};