chore: update runtime (#3312)
This commit is contained in:
@@ -249,7 +249,7 @@ export const createConfiguration: (
|
|||||||
inject: 'body',
|
inject: 'body',
|
||||||
scriptLoading: 'defer',
|
scriptLoading: 'defer',
|
||||||
minify: false,
|
minify: false,
|
||||||
chunks: ['index'],
|
chunks: ['index', 'plugin'],
|
||||||
filename: 'index.html',
|
filename: 'index.html',
|
||||||
}),
|
}),
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
|
|||||||
@@ -15,9 +15,14 @@ export default async function (cli_env: any, _: any) {
|
|||||||
return merge(config, {
|
return merge(config, {
|
||||||
entry: {
|
entry: {
|
||||||
index: {
|
index: {
|
||||||
asyncChunks: true,
|
asyncChunks: false,
|
||||||
import: resolve(rootPath, 'src/index.tsx'),
|
import: resolve(rootPath, 'src/index.tsx'),
|
||||||
},
|
},
|
||||||
|
plugin: {
|
||||||
|
dependOn: ['index'],
|
||||||
|
asyncChunks: true,
|
||||||
|
import: resolve(rootPath, 'src/bootstrap/register-plugins.ts'),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { rootStore } from '@toeverything/plugin-infra/manager';
|
|||||||
|
|
||||||
import { WorkspaceAdapters } from '../adapters/workspace';
|
import { WorkspaceAdapters } from '../adapters/workspace';
|
||||||
|
|
||||||
|
console.log('setup global');
|
||||||
setupGlobal();
|
setupGlobal();
|
||||||
|
|
||||||
rootStore.set(
|
rootStore.set(
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ if (runtimeConfig.enablePlugin) {
|
|||||||
import('@affine/copilot');
|
import('@affine/copilot');
|
||||||
}
|
}
|
||||||
|
|
||||||
export {};
|
console.log('register plugins finished');
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ async function main() {
|
|||||||
assertExists(root);
|
assertExists(root);
|
||||||
|
|
||||||
createRoot(root).render(<App />);
|
createRoot(root).render(<App />);
|
||||||
await import('./bootstrap/register-plugins');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await main();
|
await main();
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import { registerPlugin } from './plugin';
|
|||||||
import { registerProtocol } from './protocol';
|
import { registerProtocol } from './protocol';
|
||||||
import { registerUpdater } from './updater';
|
import { registerUpdater } from './updater';
|
||||||
|
|
||||||
|
app.enableSandbox();
|
||||||
|
|
||||||
if (require('electron-squirrel-startup')) app.quit();
|
if (require('electron-squirrel-startup')) app.quit();
|
||||||
// allow tests to overwrite app name through passing args
|
// allow tests to overwrite app name through passing args
|
||||||
if (process.argv.includes('--app-name')) {
|
if (process.argv.includes('--app-name')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user