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 4, 2023
1 parent 11600c3 commit f011df6
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 @@ -343,7 +343,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 f011df6

Please sign in to comment.