Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin-webpack): support for dev server custom headers #3653

Merged
merged 5 commits into from
Sep 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
support for dev server custom headers
  • Loading branch information
rahul-sachdeva22 authored and BlackHole1 committed Aug 21, 2024
commit a7bf2597150f6dc29a4207e15d7f65d358952a60
5 changes: 5 additions & 0 deletions packages/plugin/webpack/src/WebpackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,16 @@ the generated files). Instead, it is ${JSON.stringify(pj.main)}`);
},
historyApiFallback: true,
};
let customHeaders = {}
if (this.config.devServer && this.config.devServer.headers) {
customHeaders = this.config.devServer.headers
}
BlackHole1 marked this conversation as resolved.
Show resolved Hide resolved
const overrides: Partial<WebpackDevServer.Configuration> = {
port: this.port,
setupExitSignals: true,
static: path.resolve(this.baseDir, 'renderer'),
headers: {
...customHeaders,
BlackHole1 marked this conversation as resolved.
Show resolved Hide resolved
'Content-Security-Policy': cspDirectives,
},
};
Expand Down