Skip to content

Commit 09b2d1f

Browse files
committed
refactor: upgrade vite
1 parent b76aaa6 commit 09b2d1f

File tree

7 files changed

+75
-26
lines changed

7 files changed

+75
-26
lines changed

.gitignore

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
110
node_modules
211
dist
3-
.DS_Store
12+
dist-ssr
413
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"Vue.volar"
4+
]
5+
}

src/vite-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

tsconfig.app.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "@vue/tsconfig/tsconfig.dom.json",
3+
"compilerOptions": {
4+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5+
6+
/* Linting */
7+
"strict": true,
8+
"noUnusedLocals": true,
9+
"noUnusedParameters": true,
10+
"noFallthroughCasesInSwitch": true,
11+
"noUncheckedSideEffectImports": true
12+
},
13+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
14+
}

tsconfig.json

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
{
2-
"compilerOptions": {
3-
"target": "esnext",
4-
"module": "esnext",
5-
"moduleResolution": "node",
6-
"strict": true,
7-
"jsx": "preserve",
8-
"sourceMap": true,
9-
"lib": ["esnext", "dom"],
10-
"types": ["vite/client"],
11-
"plugins": [{ "name": "@vuedx/typescript-plugin-vue" }]
12-
},
13-
"include": [
14-
"src/**/*.ts",
15-
"src/**/*.d.ts",
16-
"src/**/*.tsx",
17-
"src/**/*.vue",
18-
"examples/**/*.ts",
19-
"examples/**/*.vue"
2+
"files": [],
3+
"references": [
4+
{ "path": "./tsconfig.app.json" },
5+
{ "path": "./tsconfig.node.json" }
206
]
217
}

tsconfig.node.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4+
"target": "ES2022",
5+
"lib": ["ES2023"],
6+
"module": "ESNext",
7+
"skipLibCheck": true,
8+
9+
/* Bundler mode */
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
12+
"isolatedModules": true,
13+
"moduleDetection": "force",
14+
"noEmit": true,
15+
16+
/* Linting */
17+
"strict": true,
18+
"noUnusedLocals": true,
19+
"noUnusedParameters": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"noUncheckedSideEffectImports": true
22+
},
23+
"include": ["vite.config.ts"]
24+
}

vite.config.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
import vue from '@vitejs/plugin-vue'
2-
import * as path from 'path'
3-
import { defineConfig } from 'vite'
1+
import { defineConfig } from "vite"
2+
import vue from "@vitejs/plugin-vue"
43

54
export default defineConfig({
65
build: {
76
lib: {
8-
name: 'vue-stripe-js',
9-
entry: path.resolve(__dirname, 'src/main.ts'),
7+
name: "vue-stripe-js",
8+
entry: "src/main.ts",
109
fileName: (format) => `vue-stripe.${format}.js`,
1110
},
1211
rollupOptions: {
1312
// make sure to externalize deps that shouldn't be bundled
1413
// into your library
15-
external: ['vue'],
14+
external: ["vue"],
1615
output: {
1716
// Provide global variables to use in the UMD build
1817
// for externalized deps
1918
globals: {
20-
vue: 'Vue',
19+
vue: "Vue",
2120
},
2221
},
2322
},

0 commit comments

Comments
 (0)