NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
Alt + S
或 Ctrl + Shift + Enter
触发切换搜索;Alt + S
/ Ctrl + Shift + Enter
触发切换搜索欢迎到Github或OpenUserJS或Greasy Fork上提出反馈意见。
编译开发可参考以下文档:
(基于Trim21的
webpack-userscript-template
工程模版开发
)
Just use this git repo as a template.
npm i
or npm ci
.npm run dev
to start your development.webpack-userscript-template/dist/index.dev.user.js
in your Chrome and install it with your userscript manager.this userscript's meta contains // @require file://path/to/dist/index.prod.user.js
,
it will run the code in index.prod.user.js
,
which take src/js/index.js as entry point.
every times you edit your metadata, you'll have to install it again,
because Tampermonkey don't read it from dist every times.
livereload is default enabled, use this chrome extension
use typescript as normal, see example
There are two ways to using a package on npm.
like original UserScript way, you will need to add them to your user script metadata's require section , and exclude them in config/webpack.config.base.js
just install a package and import it in your js file. webpack will pack them with in your final production js file.
npm run build
dist/index.prod.user.js
is the finally script. you can manually copy it to greaskfork for deploy.
github actions will deploy production userscript to gh-pages branch.
You can auto use greskfork's auto update function.
Rating: 0