I'm trying to make use of ES6 modules syntax, and thus package several JS files (which contain import and export statements) into one browser-readable file.
I get no errors, so why are my 2 source files here, not compiled into my one destination file? What attribute am I missing in this pipeline? Thanks
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
development: {
src: [
"src/js/test_file_one.js",
"src/js/test_file_two.js"
],
dest: 'assets/js/es6_script.min.js',
options: {
browserifyOptions: { debug: true },
presets: ['@babel/preset-env']
}
}
},
watch: {
js: {
files: "src/js/*.js",
tasks: "browserify"
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', 'grunt-browserify');
};