chore: removing the deprecations

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-04-15 11:14:04 +02:00
parent b207f4f503
commit 66fbcce83c
2 changed files with 12 additions and 16 deletions
+6 -13
View File
@@ -26,23 +26,16 @@ export async function serveBackend(options: BackendServeOptions) {
isDev: true,
});
const compiler = webpack(config);
const watcher = compiler.watch(
{
poll: true,
},
(err: Error | undefined) => {
if (err) {
console.error(err);
} else console.log('Build succeeded');
},
);
const compiler = webpack(config, (err: Error | undefined) => {
if (err) {
console.error(err);
} else console.log('Build succeeded');
});
const waitForExit = async () => {
for (const signal of ['SIGINT', 'SIGTERM'] as const) {
process.on(signal, () => {
watcher.close(() => console.log('Stopped watcher'));
compiler.close(() => console.log('Stopped watcher'));
// exit instead of resolve. The process is shutting down and resolving a promise here logs an error
process.exit();
});
+6 -3
View File
@@ -258,7 +258,7 @@ export async function createBackendConfig(
modulesDir: paths.rootNodeModules,
additionalModuleDirs: moduleDirs,
allowlist: ['webpack/hot/poll?100', ...localPackageNames],
}) as any,
}),
],
target: 'node' as const,
node: {
@@ -358,8 +358,11 @@ function nodeExternalsWithResolve(
},
});
return (context: string, request: string, callback: any) => {
currentContext = context;
return (
{ context, request }: { context?: string; request?: string },
callback: any,
) => {
currentContext = context!;
return externals(context, request, callback);
};
}