chore: maybe fix stuff

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-08-05 05:21:02 +02:00
parent eb294ea987
commit f0fbf3a16d
3 changed files with 34 additions and 23 deletions
+25 -22
View File
@@ -42,28 +42,31 @@ export async function serveBundle(options: ServeOptions) {
});
const compiler = webpack(config);
const server = new WebpackDevServer(compiler, {
hot: !process.env.CI,
devMiddleware: {
publicPath: config.output?.publicPath as string,
stats: 'errors-warnings',
},
static: {
publicPath: config.output?.publicPath as string,
directory: paths.targetPublic,
},
historyApiFallback: {
// Paths with dots should still use the history fallback.
// See https://github.com/facebookincubator/create-react-app/issues/387.
disableDotRule: true,
},
https: url.protocol === 'https:',
host,
port,
proxy: pkg.proxy,
// When the dev server is behind a proxy, the host and public hostname differ
allowedHosts: [url.hostname],
});
const server = new WebpackDevServer(
compiler as any,
{
hot: !process.env.CI,
devMiddleware: {
publicPath: config.output?.publicPath as string,
stats: 'errors-warnings',
},
static: {
publicPath: config.output?.publicPath as string,
directory: paths.targetPublic,
},
historyApiFallback: {
// Paths with dots should still use the history fallback.
// See https://github.com/facebookincubator/create-react-app/issues/387.
disableDotRule: true,
},
https: url.protocol === 'https:',
host,
port,
proxy: pkg.proxy,
// When the dev server is behind a proxy, the host and public hostname differ
allowedHosts: [url.hostname],
} as any,
);
await new Promise<void>((resolve, reject) => {
server.listen(port, host, (err?: Error) => {