mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor: webpack config (#11421)
This commit is contained in:
3
packages/common/env/package.json
vendored
3
packages/common/env/package.json
vendored
@@ -12,7 +12,8 @@
|
||||
"./workspace": "./src/workspace.ts",
|
||||
"./workspace/legacy-cloud": "./src/workspace/legacy-cloud/index.ts",
|
||||
"./filter": "./src/filter.ts",
|
||||
"./blocksuite": "./src/blocksuite/index.ts"
|
||||
"./blocksuite": "./src/blocksuite/index.ts",
|
||||
"./worker": "./src/worker.ts"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@affine/templates": "workspace:*",
|
||||
|
||||
1
packages/common/env/src/global.ts
vendored
1
packages/common/env/src/global.ts
vendored
@@ -17,6 +17,7 @@ export function setupGlobal() {
|
||||
isMobile: false,
|
||||
isSelfHosted: false,
|
||||
publicPath: '/',
|
||||
workerPath: '/js/',
|
||||
};
|
||||
|
||||
if (globalThis.navigator) {
|
||||
|
||||
7
packages/common/env/src/worker.ts
vendored
Normal file
7
packages/common/env/src/worker.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export function getWorkerUrl(name: string) {
|
||||
if (BUILD_CONFIG.debug && !name.endsWith('.worker.js')) {
|
||||
throw new Error(`worker should be named with '.worker.js', get ${name}`);
|
||||
}
|
||||
|
||||
return environment.workerPath + name + '?v=' + BUILD_CONFIG.appVersion;
|
||||
}
|
||||
Reference in New Issue
Block a user