Search code examples
gruntjsgulpwebpackwebpack-style-loaderhtml-webpack-plugin

Webpack perform some post build script task


I amusing webpack to generate bundle for my application. After bundle is generated, I need to perform following task.

  1. Open the bundle file and rename certain path. Because of the way we have setup put website, I am forced to change the path in the bundle we have created. Currently I am manually changing the path. So basically I am looking to run a task which will look for XXXX text and replace it with YYYY in the bundle.
  2. After I rename the keys/text, I want to uglify the content to minify the file.

What options do I have. I am new to webpack and I am looking for possible solutions.


Solution

  • Have you checked out string-replace-loader?

    I would use this to run a "replace" task after you've generated your bundle. Essentially, this automates what you are currently doing.