Skip to content

Commit

Permalink
Add correct mime type to headers (flyteorg#240)
Browse files Browse the repository at this point in the history
* Moved serve middleware to apply to both prod and dev builds

* Refactored next funciton

Signed-off-by: Jason Porter <[email protected]>
  • Loading branch information
jsonporter authored Nov 18, 2021
1 parent 1a0c00c commit 01b0930
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,18 @@ export const clientConfig: webpack.Configuration = {
new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true }),
favIconPlugin,
statsWriterPlugin,
getDefinePlugin(false)
getDefinePlugin(false),
new ServePlugin({
middleware: (app, builtins) =>
app.use(async (ctx, next) => {
ctx.setHeader(
'Content-Type',
'application/javascript; charset=UTF-8'
);
await next();
}),
port: 7777
})
];

// Apply production specific configs
Expand All @@ -291,19 +302,8 @@ export const clientConfig: webpack.Configuration = {

if (isDev) {
return [
...plugins,
...plugins
// namedModulesPlugin,
new ServePlugin({
middleware: (app, builtins) =>
app.use(async (ctx, next) => {
await next();
ctx.setHeader(
'Content-Type',
'application/javascript; charset=UTF-8'
);
}),
port: 7777
})
];
}

Expand Down

0 comments on commit 01b0930

Please sign in to comment.