From 30e447479199b93065a0dfc658644fe51271e7d8 Mon Sep 17 00:00:00 2001 From: hexf00 Date: Wed, 13 Nov 2024 19:32:50 +0800 Subject: [PATCH] chore: add license on worker.js --- .github/server/server.js | 2 +- vite.config.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/server/server.js b/.github/server/server.js index fc115ac..cd68fed 100644 --- a/.github/server/server.js +++ b/.github/server/server.js @@ -33,7 +33,7 @@ function createSiteStatic() { console.warn('\x1B[33m%s\x1B[0m', `Warning: Unable to read ${licenseFilePath}. Work on Free Mode, if you want to use the Business Mode, you can get a 30-day free trial license from https://univer.ai/pro/license`) } - const filesToReplace = ['main.js'] + const filesToReplace = ['main.js', 'worker.js'] filesToReplace.forEach((file) => { const filePath = join(targetDir, file) if (fs.existsSync(filePath)) { diff --git a/vite.config.ts b/vite.config.ts index b025c50..7b6e56c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -18,6 +18,13 @@ export default ({ mode }) => { 'process.env.UNIVER_CLIENT_LICENSE': `"${env.UNIVER_CLIENT_LICENSE}"` || '"%%UNIVER_CLIENT_LICENSE_PLACEHOLDER%%"', }, base: './', + worker: { + rollupOptions: { + output: { + entryFileNames: 'worker.js', + }, + }, + }, build: { rollupOptions: { output: {