So I have this in my gruntfile:
gruntConfig.babel = {
options: {
sourceMap: true
},
dist: {
files: {
"dist/server.js": "src/*.js"
}
}
};
This correctly transpiles all the js files in src, but it overwrites dist/server.js every time.
This must be really simple, but I can't seem to figure out how to make it write to different output files, one for each sourcefile.
It's can be achieved by using dynamic files mapping.
For your case config will look like this:
gruntConfig.babel = {
options: {
sourceMap: true
},
dist: {
files: [
{
expand: true,
cwd: 'src/',
src: ['*.js'],
dest: 'dist/'
}
]
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With