I have just started using grunt and I want it to use combine all files and uglify them. But my issues is that it combines and uglifys, but it doesn't remove import statements. (I'm using uglify and concat)
What I want -
// File.js
import something from './something.js';
something.someFunction("hello world");
and
// something.js
export default {
someFunction: function(msg){console.log(msg)}
}
to
// all.js
var something = {
someFunction: function(msg){
console.log(msg)
}
}
something.someFunction("hello world");
Compressing is not an issue.
If you want to combine the source code into one file, you can use rollup.js to help you.
npm install -g npmnpm install -g rolluprollup -vAnd then, running the below command will work as you expected.
You can generate by
rollup.config.jsalso.For compress
npm install uglify-js -guglifyjs all.js -m -c -o all.min.js