Is there a way to run watch on webpack and grunt running in a sequence

243 Views Asked by At

I am running webpack and grunt in a sequence. Weback compiles my JavaScript code, and grunt deploys that code to a local apache server. Here's my npm script:

package.json:

...
"scripts": {
  "build": "webpack && grunt"
}

I have scenario where I need to run watch on both. Is there a way to do that?

I have already tried using grunt-webpack for webpack but unfortunately it is not working properly with my webpack.config.

1

There are 1 best solutions below

3
sdgluck On

Use webpack-shell-plugin:

plugins: [
  new WebpackShellPlugin({
    onBuildEnd: ['gulp']
  })
]