🚀 Vite + Svelte Tampermonkey boilerplate
English | 简体ä¸æ–‡
src/header.js
can edit tampermonkey header info
npm install
npm run dev
- Copy
dist/main.user.dev.js
to tampermonkey - Visit 百度,you can see the effect in the upper right corner
- Every time you modify the code, it will be hot updated. You only need to refresh the page
npm run build
- Release
dist/main.user.js
- "no runtime" and The file size is small enough to meet the script release requirements
- Tree Shaking
- The responsive provided by Svelte fully meets the needs of script development
- Rollup packaging is fast
- More...
- This is not absolute. Of course, you can use ts
- Scripts often iterate very fast. In most cases, using TS will only increase the mental burden
- Reduce unnecessary trouble and make development more flexible
- In order to meet most of the needs
- Facilitate the decoupling of all modules without affecting each other's development
├─dist
└─src
├─pages
│ └─www
│ └─packages
│ └─TestA
│ ├─apis
│ ├─components
│ └─views
└─utils
- The folders under
pages
are recommended to be classified according to the secondary domain name, for example:- www.baidu.com => www
- test.baidu.com => test
- If you need a responsive div, create a new
svelte file
underviews
to write it - In other cases, you can write JS files normally