fix(backend): server standalone backend plugins
This commit is contained in:
@@ -182,7 +182,11 @@ export function createBackendConfig(
|
||||
},
|
||||
devtool: isDev ? 'cheap-module-eval-source-map' : 'source-map',
|
||||
context: paths.targetPath,
|
||||
entry: ['webpack/hot/poll?100', paths.targetEntry],
|
||||
entry: [
|
||||
'webpack/hot/poll?100',
|
||||
paths.targetEntry,
|
||||
...(paths.targetRunFile ? [paths.targetRunFile] : []),
|
||||
],
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
|
||||
mainFields: ['main:src', 'browser', 'module', 'main'],
|
||||
|
||||
@@ -48,10 +48,15 @@ export function resolveBundlingPaths(options: BundlingPathsOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
// Backend plugin dev run file
|
||||
const targetRunFile = paths.resolveTarget('src/run.ts');
|
||||
const runFileExists = fs.pathExistsSync(targetRunFile);
|
||||
|
||||
return {
|
||||
targetHtml,
|
||||
targetPublic,
|
||||
targetPath: paths.resolveTarget('.'),
|
||||
targetRunFile: runFileExists ? targetRunFile : undefined,
|
||||
targetDist: paths.resolveTarget('dist'),
|
||||
targetAssets: paths.resolveTarget('assets'),
|
||||
targetSrc: paths.resolveTarget('src'),
|
||||
|
||||
Reference in New Issue
Block a user