From 1d7932851e580b849e728751f0a8965a0021aed9 Mon Sep 17 00:00:00 2001 From: forehalo Date: Fri, 13 Sep 2024 09:21:29 +0000 Subject: [PATCH] chore: remove type module in scripts (#8240) fix AF-1385 --- .../src/core/doc-renderer/controller.ts | 77 +++++++++++-------- tools/cli/src/webpack/template.html | 2 +- tools/cli/src/webpack/webpack.config.ts | 1 - 3 files changed, 44 insertions(+), 36 deletions(-) diff --git a/packages/backend/server/src/core/doc-renderer/controller.ts b/packages/backend/server/src/core/doc-renderer/controller.ts index 9d69ae14ba..fff14f545a 100644 --- a/packages/backend/server/src/core/doc-renderer/controller.ts +++ b/packages/backend/server/src/core/doc-renderer/controller.ts @@ -154,40 +154,49 @@ export class DocRendererController { const summary = opts ? htmlSanitize(opts.summary) : assets.description; const image = opts?.avatar ?? 'https://affine.pro/og.jpeg'; - return ` - - - - - - ${title} - - - - - - - ${!opts ? '' : ''} - - - - - - - - ${assets.css.map(url => ``).join('\n')} - - -
- ${assets.js.map(url => ``).join('\n')} - - + // TODO(@forehalo): parse assets/index.html + return ` + + + + + + + + + + ${title} + + + + + + + + ${!opts ? '' : ''} + + + + + + + + ${assets.css.map(url => ``).join('\n')} + + +
+ ${assets.js.map(url => ``).join('\n')} + + `; } } diff --git a/tools/cli/src/webpack/template.html b/tools/cli/src/webpack/template.html index 3a80c2874e..792ff67b9c 100644 --- a/tools/cli/src/webpack/template.html +++ b/tools/cli/src/webpack/template.html @@ -20,6 +20,7 @@ + @@ -39,7 +40,6 @@ - diff --git a/tools/cli/src/webpack/webpack.config.ts b/tools/cli/src/webpack/webpack.config.ts index 01d7f0d1e4..018f5edba0 100644 --- a/tools/cli/src/webpack/webpack.config.ts +++ b/tools/cli/src/webpack/webpack.config.ts @@ -45,7 +45,6 @@ export function createWebpackConfig(cwd: string, flags: BuildFlags) { return new HTMLPlugin({ template: join(rootPath, 'webpack', 'template.html'), inject: 'body', - scriptLoading: 'module', minify: false, chunks: [entryName], filename: `${entryName === 'app' ? 'index' : entryName}.html`, // main entry should take name index.html