mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
feat(core): new worker workspace engine (#9257)
This commit is contained in:
@@ -99,6 +99,19 @@ export function createShellHTMLPlugin(
|
||||
});
|
||||
}
|
||||
|
||||
export function createBackgroundWorkerHTMLPlugin(
|
||||
flags: BuildFlags,
|
||||
BUILD_CONFIG: BUILD_CONFIG_TYPE
|
||||
) {
|
||||
const htmlPluginOptions = getHTMLPluginOptions(flags, BUILD_CONFIG);
|
||||
|
||||
return new HTMLPlugin({
|
||||
...htmlPluginOptions,
|
||||
chunks: ['backgroundWorker'],
|
||||
filename: `background-worker.html`,
|
||||
});
|
||||
}
|
||||
|
||||
export function createHTMLPlugins(
|
||||
flags: BuildFlags,
|
||||
BUILD_CONFIG: BUILD_CONFIG_TYPE
|
||||
|
||||
@@ -14,7 +14,11 @@ import webpack from 'webpack';
|
||||
import type { Configuration as DevServerConfiguration } from 'webpack-dev-server';
|
||||
|
||||
import { productionCacheGroups } from './cache-group.js';
|
||||
import { createHTMLPlugins, createShellHTMLPlugin } from './html-plugin.js';
|
||||
import {
|
||||
createBackgroundWorkerHTMLPlugin,
|
||||
createHTMLPlugins,
|
||||
createShellHTMLPlugin,
|
||||
} from './html-plugin.js';
|
||||
import { WebpackS3Plugin } from './s3-plugin.js';
|
||||
import type { BuildFlags } from './types';
|
||||
|
||||
@@ -426,6 +430,7 @@ export function createWebpackConfig(
|
||||
|
||||
if (buildConfig.isElectron) {
|
||||
config.plugins.push(createShellHTMLPlugin(flags, buildConfig));
|
||||
config.plugins.push(createBackgroundWorkerHTMLPlugin(flags, buildConfig));
|
||||
}
|
||||
|
||||
return config;
|
||||
|
||||
@@ -527,6 +527,7 @@ export const PackageList = [
|
||||
'packages/frontend/core',
|
||||
'packages/frontend/electron-api',
|
||||
'packages/frontend/i18n',
|
||||
'packages/common/nbstore',
|
||||
'packages/common/infra',
|
||||
'tools/utils',
|
||||
],
|
||||
@@ -552,6 +553,7 @@ export const PackageList = [
|
||||
'packages/frontend/component',
|
||||
'packages/frontend/core',
|
||||
'packages/frontend/i18n',
|
||||
'packages/common/nbstore',
|
||||
'blocksuite/affine/all',
|
||||
'packages/common/infra',
|
||||
],
|
||||
@@ -563,6 +565,7 @@ export const PackageList = [
|
||||
'packages/frontend/component',
|
||||
'packages/frontend/core',
|
||||
'packages/frontend/i18n',
|
||||
'packages/common/nbstore',
|
||||
'packages/common/infra',
|
||||
],
|
||||
},
|
||||
@@ -587,6 +590,7 @@ export const PackageList = [
|
||||
'packages/common/env',
|
||||
'packages/frontend/graphql',
|
||||
'packages/frontend/i18n',
|
||||
'packages/common/nbstore',
|
||||
'packages/frontend/templates',
|
||||
'packages/frontend/track',
|
||||
'blocksuite/affine/all',
|
||||
|
||||
Reference in New Issue
Block a user