mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
refactor: webpack config (#11421)
This commit is contained in:
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