feat: 添加bun-test项目并配置Rollup打包
新增bun-test项目,包含Rollup配置、lodash-es依赖及示例代码,同时更新pnpm-lock.yaml
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { main } from './sw2.js';
|
||||
import { main } from '/sw2.js';
|
||||
self.onmessage = function (e) {
|
||||
console.log(e.data, typeof e.data);
|
||||
main(e.data);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const root = document.querySelector('#root');
|
||||
root.innerHTML = '<h1>Hello World</h1>';
|
||||
|
||||
const worker = new Worker('./public/sw.js', { type: 'module' });
|
||||
const worker = new Worker('/sw.js', { type: 'module' });
|
||||
|
||||
worker.onmessage = (event) => {
|
||||
console.log(event.data);
|
||||
|
||||
Reference in New Issue
Block a user