webpack有类似如下的api吗
webpack.on("after-emit",function(){
//我的代码
//...
});
在webpack构建完成后,我需要执行一些移动文件的操作,将源码中指定的文件移动到生成的文件夹中,请问应该怎么做?
巴扎黑2017-04-17 15:04:30
webpack itself provides Node.js api, which can be started in a script:
var webpack = require("webpack");
// returns a Compiler instance
webpack({
// configuration
}, function(err, stats) {
// ...
});
Then you can move on to other things
So you can write the startup of webpack and other required operations in the same script, and then run the script directly in the console