{"repo":"trim21/webpack-userscript-template","free":true,"listed":false,"github":"https://github.com/trim21/webpack-userscript-template","clone":"git clone https://github.com/trim21/webpack-userscript-template.git","description":"template to build userscript with webpack","language":"JavaScript","stars":156,"topics":["webpack","userscript","template","typescript","fetch"],"license":"WTFPL","category":"saas-starters-boilerplates","readme_excerpt":"This is a project help you build userscript with webpack Just use this git repo as a template. 中文说明 dev 1. Allow Tampermonkey's access to local file URIs tampermonkey/faq 2. install deps with npm i or npm ci . 3. npm run dev to start your development. Now you will see 2 files in ./dist/ - dist/index.dev.user.js : You should install this userscript in your browser. It's a simple loader that load dist/index.debug.js on matched web page. - dist/index.debug.js : This is the development build with eval-source-map . It will be automatically loaded by dist/index.dev.user.js via @require file://.../dist/index.debug.js metadata, Don't add it to your userscript manager. 4. edit src/index.ts, you can even import css or less files. You can use scss if you like. 5. go wo and open console, you'll see it's working. livereload is default enabled, use this Chrome extension NOTICE Everytime you change your metadata config, you'll have to restart webpack server and install newly generated dist/index.dev.user.js UserScript in your browser again. used package If you prefer some other bundler like rollup, you can use some of these packages directly. userscript-metadata-generator gm-fetch userscript-metadata-webpack-plugin Cross Site Request you can call GM.xmlHttpRequest directly or use a fetch API based on GM.xmlHttpRequest TypeScript use typescript as normal, see example dependencies There are two ways to using a package on npm. UserScript way like original UserScript way, you will need to add t","default_branch":null,"files":null,"tree":[],"storefront":"/r/trim21","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/trim21/webpack-userscript-template/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}