mirror of
https://github.com/hanzoai/vite.git
synced 2026-10-30 19:36:16 +00:00
13 lines
305 B
JavaScript
13 lines
305 B
JavaScript
let base = `/${self.location.pathname.split('/')[1]}`
|
|
if (base === `/worker-entries`) base = '' // relative base
|
|
|
|
importScripts(`${base}/classic.js`)
|
|
|
|
self.onconnect = (event) => {
|
|
const port = event.ports[0]
|
|
port.postMessage(self.constant)
|
|
}
|
|
|
|
// for sourcemap
|
|
console.log('classic-shared-worker.js')
|