Skip to content

Commit

Permalink
feat: vite plugin starter
Browse files Browse the repository at this point in the history
  • Loading branch information
linbudu599 committed Mar 15, 2022
1 parent 2264535 commit 8f5b947
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Mobx -> React
- MobxStateTree + GraphQL
- Workflow: GitHub Actions
- Node Lib

## Scripts

Expand Down
16 changes: 16 additions & 0 deletions packages/vite-plugin-starter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "vite-plugin-starter",
"version": "0.0.1",
"description": "",
"main": "./dist/index.js",
"license": "MIT",
"scripts": {
"build": "tsc",
"dev": "tsnd --respawn --transpile-only src/index.ts",
"watch": "tsc --watch",
"check": "tsc --noEmit"
},
"devDependencies": {
"vite": "^2.7.2"
}
}
18 changes: 18 additions & 0 deletions packages/vite-plugin-starter/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Plugin } from 'vite';

export function vitePluginStarter(options: Record<string, unknown>): Plugin {
return {
name: 'vite-plugin-starter',
enforce: 'pre',
apply: (config, env) => true,
config: (config, env) => config,
configResolved: async (config) => {},
configureServer: (server) => {},
// resolveId
// load
handleHotUpdate: async (ctx) => {},
transform: (code: any) => {
return code;
},
};
}
20 changes: 20 additions & 0 deletions packages/vite-plugin-starter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"lib": [
"esnext"
],
"rootDir": "src",
"outDir": "dist",
"esModuleInterop": true,
"skipLibCheck": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"include": [
"src"
]
}
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 8f5b947

Please sign in to comment.