diff --git a/rspack.config.ts b/rspack.config.ts index f25bb7c..57d416b 100644 --- a/rspack.config.ts +++ b/rspack.config.ts @@ -24,6 +24,7 @@ export default defineConfig({ context: __dirname, entry: { service_worker: `${src}/service_worker.ts`, + sandbox: `${src}/sandbox.ts`, popup: `${src}/pages/popup/main.tsx`, }, output: { @@ -104,6 +105,13 @@ export default defineConfig({ minify: true, chunks: ["popup"], }), + new rspack.HtmlRspackPlugin({ + filename: `${dist}/ext/src/sandbox.html`, + template: `${src}/pages/sandbox.html`, + inject: "head", + minify: true, + chunks: ["sandbox"], + }), ].filter(Boolean), optimization: { minimizer: [ diff --git a/src/manifest.json b/src/manifest.json index 916f5e9..f4e6860 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -17,5 +17,12 @@ "128": "assets/logo.png" }, "default_locale": "zh_CN", - "permissions": [] + "permissions": [ + "offscreen" + ], + "sandbox": { + "pages": [ + "sandbox.html" + ] + } } \ No newline at end of file diff --git a/src/pages/sandbox.html b/src/pages/sandbox.html new file mode 100644 index 0000000..91d493c --- /dev/null +++ b/src/pages/sandbox.html @@ -0,0 +1,10 @@ + + +
+ + + +