Skip to content

Commit 3362312

Browse files
committed
chore: use vite instead of webpack for the demo page
1 parent f60e34d commit 3362312

File tree

6 files changed

+807
-2741
lines changed

6 files changed

+807
-2741
lines changed

build/tsconfig.webpack.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

build/vite.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import vue from '@vitejs/plugin-vue';
2+
import vueJsx from '@vitejs/plugin-vue-jsx';
3+
import path from 'path';
4+
import { defineConfig } from 'vite';
5+
6+
export default defineConfig({
7+
clearScreen: false,
8+
resolve: {
9+
alias: {
10+
'vue-request': path.resolve(__dirname, '../src/index.ts'),
11+
},
12+
},
13+
plugins: [vue(), vueJsx()],
14+
});

build/webpack.config.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

example/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
</head>
99
<body>
1010
<div id="app"></div>
11+
<script type="module" src="./main.ts"></script>
1112
<!-- built files will be auto injected -->
1213
</body>
1314
</html>

package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@
3030
],
3131
"scripts": {
3232
"build": "yarn clean && rollup --config ./build/rollup.config.js",
33-
"dev": "webpack serve --config ./build/webpack.config.js",
33+
"dev": "yarn vite ./example",
3434
"clean": "rimraf dist/*",
3535
"test": "jest --coverage",
3636
"publishing": "np",
3737
"changelog": "standard-version && standard-version -i CHANGELOG.zh-CN.md -o CHANGELOG.zh-CN.md",
3838
"release": "yarn build && yarn publishing",
3939
"lint": "eslint -c ./.eslintrc.js './{src,scripts,build}/**/*.{js,ts,tsx}'",
4040
"format": "prettier -w '**/*.ts?(x)'",
41-
"version": "yarn changelog"
41+
"version": "yarn changelog",
42+
"vite": "vite --config ./build/vite.config.ts"
4243
},
4344
"husky": {
4445
"hooks": {
@@ -71,18 +72,18 @@
7172
"@types/mockjs": "^1.0.3",
7273
"@typescript-eslint/eslint-plugin": "^4.8.2",
7374
"@typescript-eslint/parser": "^4.8.2",
75+
"@vitejs/plugin-vue": "^1.2.1",
76+
"@vitejs/plugin-vue-jsx": "^1.1.3",
7477
"@vue/babel-plugin-jsx": "^1.0.0-rc.3",
7578
"@vue/compiler-sfc": "^3.0.6",
7679
"@vue/test-utils": "^2.0.0-beta.8",
7780
"axios": "^0.21.1",
7881
"babel-jest": "^26.6.0",
79-
"babel-loader": "^8.2.1",
8082
"eslint": "^7.14.0",
8183
"eslint-config-prettier": "^6.15.0",
8284
"eslint-plugin-prettier": "^3.1.4",
8385
"eslint-plugin-vue": "^7.0.0-0",
8486
"fetch-mock": "^9.10.7",
85-
"html-webpack-plugin": "^4.5.0",
8687
"husky": "^4.3.0",
8788
"jest": "^26.6.0",
8889
"jest-environment-jsdom-global": "^2.0.4",
@@ -99,12 +100,8 @@
99100
"simple-git": "^2.21.0",
100101
"standard-version": "^9.1.1",
101102
"ts-jest": "^26.4.1",
102-
"ts-loader": "^8.0.11",
103103
"typescript": "^4.0.5",
104-
"vue": "^3.0.2",
105-
"vue-loader": "^16.1.2",
106-
"webpack": "^5.4.0",
107-
"webpack-cli": "^4.2.0",
108-
"webpack-dev-server": "^3.11.0"
104+
"vite": "^2.1.5",
105+
"vue": "^3.0.2"
109106
}
110107
}

0 commit comments

Comments
 (0)