Run command after webpack build

后端 未结 7 1779
名媛妹妹
名媛妹妹 2020-12-04 15:29

I\'d like to run webpack in --watch mode, and run a shell command after each build that synchronizes a folder to another one.

I found this plugin that t

7条回答
  •  天命终不由人
    2020-12-04 15:52

    Use webpack-shell-plugin

    How to Use:

    const WebpackShellPlugin = require('webpack-shell-plugin');
    
    
        module.exports = {
          ...
          ...
          plugins: [
            new WebpackShellPlugin({onBuildStart:['echo "Webpack Start"'], onBuildEnd:['echo "Webpack End"']})
          ],
          ...
        }
    

提交回复
热议问题