nickjj / manifest-revision-webpack-plugin

Write out a manifest file containing your versioned webpack chunks and assets.
ISC License
124 stars 40 forks source link

Another publicPath for production mode #50

Closed lipton-v closed 5 years ago

lipton-v commented 5 years ago

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?

nickjj commented 5 years ago

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.

lipton-v commented 5 years ago

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.

lipton-v commented 5 years ago

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