feat: 添加web项目基础配置和依赖
添加web项目基础结构,包括vite配置、ts配置、package.json和示例代码 添加pnpm工作区配置 更新.gitignore包含pnpm-store
This commit is contained in:
11
web/src/main.ts
Normal file
11
web/src/main.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
const root = document.querySelector('#root');
|
||||
root.innerHTML = '<h1>Hello World</h1>';
|
||||
|
||||
const worker = new Worker('./public/sw.js', { type: 'module' });
|
||||
|
||||
worker.onmessage = (event) => {
|
||||
console.log(event.data);
|
||||
};
|
||||
|
||||
worker.postMessage({ type: 'ping' });
|
||||
worker.postMessage({ type: 'pong' });
|
||||
Reference in New Issue
Block a user