Skip to content

Commit

Permalink
feat: 🎸 combine utools plugin and tampermonkey in one template
Browse files Browse the repository at this point in the history
combine utools plugin and  tampermonkey in one template
  • Loading branch information
lgf-136 committed Sep 28, 2022
1 parent f4a7faa commit 5f0f7e6
Show file tree
Hide file tree
Showing 57 changed files with 611 additions and 61 deletions.
2 changes: 1 addition & 1 deletion config
100 changes: 98 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions projects/all-in-one-template/config/tampermonkey/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

## tampermonkey react-ts

```
pnpm add -D @types/node @types/react @types/react-dom @vitejs/plugin-react typescript vite vite-plugin-monkey
pnpm add react react-dom
```

## tampermonkey preact-ts

```
pnpm add -D typescript vite vite-plugin-monkey @types/node @preact/preset-vite
pnpm add preact
```

## tampermonkey vue-ts

```
pnpm add -D @types/node @vitejs/plugin-vue typescript vite vite-plugin-monkey vue-tsc
pnpm add vue
```

## tampermonkey vanilla-ts

```
pnpm add -D typescript vite vite-plugin-monkey @types/node
pnpm add
```

## tampermonkey solid-ts

```
pnpm add -D typescript vite vite-plugin-monkey @types/nodes
pnpm add
```

## tampermonkey svelte-ts

```
pnpm add -D typescript vite vite-plugin-monkey @types/node @sveltejs/vite-plugin-svelte@tsconfig/svelte svelte svelte-check svelte-preprocess tslib
pnpm add
```
23 changes: 23 additions & 0 deletions projects/all-in-one-template/config/tampermonkey/preact-ts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import monkey, { cdn } from 'vite-plugin-monkey';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
preact(),
monkey({
entry: 'src/main.tsx',
userscript: {
icon: 'https://vitejs.dev/logo.svg',
namespace: 'npm/vite-plugin-monkey',
match: [ 'https://www.google.com/' ],
},
build: {
externalGlobals: {
preact: cdn.jsdelivr('preact', 'dist/preact.min.js'),
},
},
}),
],
});
23 changes: 23 additions & 0 deletions projects/all-in-one-template/config/tampermonkey/preact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import monkey, { cdn } from 'vite-plugin-monkey';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
preact(),
monkey({
entry: 'src/main.tsx',
userscript: {
icon: 'https://vitejs.dev/logo.svg',
namespace: 'npm/vite-plugin-monkey',
match: [ 'https://www.google.com/' ],
},
build: {
externalGlobals: {
preact: cdn.jsdelivr('preact', 'dist/preact.min.js'),
},
},
}),
],
});
27 changes: 27 additions & 0 deletions projects/all-in-one-template/config/tampermonkey/react-ts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import monkey, { cdn } from 'vite-plugin-monkey';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
monkey({
entry: 'src/main.tsx',
userscript: {
icon: 'https://vitejs.dev/logo.svg',
namespace: 'npm/vite-plugin-monkey',
match: [ 'https://segmentfault.com/' ],
},
build: {
externalGlobals: {
react: cdn.jsdelivr('React', 'umd/react.production.min.js'),
'react-dom': cdn.jsdelivr(
'ReactDOM',
'umd/react-dom.production.min.js',
),
},
},
}),
],
});
27 changes: 27 additions & 0 deletions projects/all-in-one-template/config/tampermonkey/react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import monkey, { cdn } from 'vite-plugin-monkey';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
monkey({
entry: 'src/main.tsx',
userscript: {
icon: 'https://vitejs.dev/logo.svg',
namespace: 'npm/vite-plugin-monkey',
match: [ 'https://segmentfault.com/' ],
},
build: {
externalGlobals: {
react: cdn.jsdelivr('React', 'umd/react.production.min.js'),
'react-dom': cdn.jsdelivr(
'ReactDOM',
'umd/react-dom.production.min.js',
),
},
},
}),
],
});
17 changes: 17 additions & 0 deletions projects/all-in-one-template/config/tampermonkey/solid-ts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';
import monkey from 'vite-plugin-monkey';

export default defineConfig({
plugins: [
solidPlugin(),
monkey({
entry: 'src/index.tsx',
userscript: {
icon: 'https://vitejs.dev/logo.svg',
namespace: 'npm/vite-plugin-monkey',
match: [ 'https://www.google.com/' ],
},
}),
],
});
17 changes: 17 additions & 0 deletions projects/all-in-one-template/config/tampermonkey/solid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';
import monkey from 'vite-plugin-monkey';

export default defineConfig({
plugins: [
solidPlugin(),
monkey({
entry: 'src/index.tsx',
userscript: {
icon: 'https://vitejs.dev/logo.svg',
namespace: 'npm/vite-plugin-monkey',
match: [ 'https://www.google.com/' ],
},
}),
],
});
Loading

0 comments on commit 5f0f7e6

Please sign in to comment.