Skip to content

Commit

Permalink
Put prefixPath in config.devServer.devMiddleware.publicPath
Browse files Browse the repository at this point in the history
After updating from webpack-dev-server v3. -> v.4 the configuration
config.devServer.publicPath is now:

config.devServer.devMiddleware.publicPath

See:

https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md#-breaking-changes

Avoid error:

ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
  • Loading branch information
wesleybl committed Jul 7, 2023
1 parent 5c387dd commit cc4266e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion razzle.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ const defaultModify = ({

if (prefixPath) {
if (target === 'web' && dev) {
config.devServer.publicPath = prefixPath;
config.devServer.devMiddleware.publicPath = prefixPath;
}
const pp = config.output.publicPath;
config.output.publicPath = `${pp}${prefixPath.slice(1)}/`;
Expand Down

0 comments on commit cc4266e

Please sign in to comment.