nickjj/manifest-revision-webpack-plugin

Another publicPath for production mode

Closed this issue · 3 comments

Hi ,
I write npm run start for development mode. This command creates manifest.json file every time.
When I write npm run build the new manifest.json is not created. For development mode I have one publicPath: 'http://localhost:2992/frontend/assets/' and for production mode i have another one. So I get a problem. On the local server everything is ok. . There is only a wrong publicPath in manifest.json on production.
Is it possible to cteate the new manifest.json file after writing npm run build with publicPath for production?

Hi,

Did you try setting and checking the NODE_ENV in your webpack config? Then you could set a different path based on it being production or not.

Actually, I have three webpack.config files: for development, for production and the common one. I have tried with NODE_ENV. But it doesn't help. The problem is that manifest.json is not rewritten after npm run build. The last manifest.json is in use after npm run start.

The issue was caused by MiniCssExtractPlugin.Wrong options. After that manifest.json is rewritten every time. My mistake.