webpack有类似如下的api吗
webpack.on("after-emit",function(){ //我的代码 //... });
在webpack构建完成后,我需要执行一些移动文件的操作,将源码中指定的文件移动到生成的文件夹中,请问应该怎么做?
业精于勤,荒于嬉;行成于思,毁于随。
You can use npm scripts, npm run webpack && npm run copy
npm run webpack && npm run copy
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
You can use npm scripts,
npm run webpack && npm run copy
webpack itself provides Node.js api, which can be started in a script:
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