All Projects → Trim21 → webpack-userscript-template

Trim21 / webpack-userscript-template

Licence: WTFPL license
template to build userscript with webpack

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
Less
1899 projects

Projects that are alternatives of or similar to webpack-userscript-template

use-axios-hooks
axios hooks for common network calls scenarios
Stars: ✭ 27 (-65.38%)
Mutual labels:  axios
redux-rest-adapter
REST adapter for redux
Stars: ✭ 13 (-83.33%)
Mutual labels:  axios
h-blog
vue+elementUI模仿我的博客,简单的写的几个练习页面
Stars: ✭ 14 (-82.05%)
Mutual labels:  axios
vue-webpack-boilerplate
A webpack boilerplate with vue-loader, axios, vue-router and vuex
Stars: ✭ 51 (-34.62%)
Mutual labels:  axios
vue-acfun
AcFun(弹幕视频网)
Stars: ✭ 25 (-67.95%)
Mutual labels:  axios
GithubDarkTheme
Dark Theme for Github
Stars: ✭ 60 (-23.08%)
Mutual labels:  userscript
vue-admin-webapp
基于vuejs+element-ui 后台管理系统
Stars: ✭ 62 (-20.51%)
Mutual labels:  axios
decensooru
Decensoring addon for Better Better Booru.
Stars: ✭ 30 (-61.54%)
Mutual labels:  userscript
fastify-axios
Add axios http client to your fastify instance
Stars: ✭ 28 (-64.1%)
Mutual labels:  axios
Vue3.0 Element ShopManage
基于vue3.0+TypeScript+Element-plus的商品后台管理
Stars: ✭ 128 (+64.1%)
Mutual labels:  axios
Vue-CAMP
VueJS
Stars: ✭ 16 (-79.49%)
Mutual labels:  axios
NeteaseCloudWebApp
This is a vue for NeteaseCloud projects!
Stars: ✭ 2,512 (+3120.51%)
Mutual labels:  axios
github-pr-reviewers
This project adds more features to github using user scripts.
Stars: ✭ 15 (-80.77%)
Mutual labels:  userscript
miniprogram-network
Redefine the Network API of Wechat MiniProgram (小程序网络库)
Stars: ✭ 93 (+19.23%)
Mutual labels:  axios
electron-admin-element-vue
Electron Vue3.x Element-UI Admin
Stars: ✭ 37 (-52.56%)
Mutual labels:  axios
ts-vue-questionnaire
微型问卷调查系统 TypeScript 版本,演示账号:admin / admin
Stars: ✭ 89 (+14.1%)
Mutual labels:  axios
r2curl
Node.js Request Wrapper (axios, fetch, ..) to cURL Command String
Stars: ✭ 30 (-61.54%)
Mutual labels:  axios
graphql-compose-elasticsearch
Graphql App using Node with typescript, KOA framework and Elasticsearch
Stars: ✭ 40 (-48.72%)
Mutual labels:  axios
shopping-cart
A vue.js project for shopping cart.
Stars: ✭ 57 (-26.92%)
Mutual labels:  axios
scripter
一些脚本和工具
Stars: ✭ 20 (-74.36%)
Mutual labels:  userscript

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.user.js on matched web page.
  • dist/index.debug.user.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.user.js metadata, Don't add it to your userscript manager.
  1. edit src/index.ts, you can even import css or less files. You can use scss if you like.
  2. go wo https://www.example.com/ 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.

Cross Site Request

you can call GM.xmlHttpRequest,

if you prefer fetch API, you can use https://github.com/Trim21/gm-fetch

If you are using axios, you can use https://github.com/Trim21/axios-userscript-adapter

(these libraries are both included already)

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 them to your user script metadata's require section , and exclude them in config/webpack.config.base.cjs

Webpack way

just install a package and import it in your js file. webpack will pack them with in your final production js file.

Build

npm run build

dist/index.prod.user.js is the final script. you can manually copy it to greaskfork for deploy.

Minify

There is a limitation in greasyfork, your code must not be obfuscated or minified.

If you don't need to deploy your script to greaskfork, enable minify as you like.

automatically Deploy

github actions will deploy production userscript to gh-pages branch.

example

deployed

You can auto use greasyfork's auto update function.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].