Skip to content

Commit 9769486

Browse files
committed
feat: migrate to type:module, support Vite 5, close #22
1 parent 43461b5 commit 9769486

9 files changed

+1427
-1551
lines changed

.eslintignore

-3
This file was deleted.

.eslintrc.json

-9
This file was deleted.

.vscode/settings.json

+39-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
11
{
2-
"typescript.tsdk": "node_modules/typescript/lib"
2+
// Enable the ESlint flat config support
3+
"eslint.experimental.useFlatConfig": true,
4+
5+
// Disable the default formatter, use eslint instead
6+
"prettier.enable": false,
7+
"editor.formatOnSave": false,
8+
9+
// Auto fix
10+
"editor.codeActionsOnSave": {
11+
"source.fixAll": "explicit",
12+
"source.organizeImports": "never"
13+
},
14+
15+
// Silent the stylistic rules in you IDE, but still auto fix them
16+
"eslint.rules.customizations": [
17+
{ "rule": "style/*", "severity": "off" },
18+
{ "rule": "*-indent", "severity": "off" },
19+
{ "rule": "*-spacing", "severity": "off" },
20+
{ "rule": "*-spaces", "severity": "off" },
21+
{ "rule": "*-order", "severity": "off" },
22+
{ "rule": "*-dangle", "severity": "off" },
23+
{ "rule": "*-newline", "severity": "off" },
24+
{ "rule": "*quotes", "severity": "off" },
25+
{ "rule": "*semi", "severity": "off" }
26+
],
27+
28+
// Enable eslint for all supported languages
29+
"eslint.validate": [
30+
"javascript",
31+
"javascriptreact",
32+
"typescript",
33+
"typescriptreact",
34+
"vue",
35+
"html",
36+
"markdown",
37+
"json",
38+
"jsonc",
39+
"yaml"
40+
]
341
}

eslint.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// @ts-check
2+
import antfu from '@antfu/eslint-config'
3+
4+
export default antfu()

examples/vanilla/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "vanila",
3-
"version": "0.0.0",
43
"type": "module",
4+
"version": "0.0.0",
55
"scripts": {
66
"dev": "vite",
77
"build": "vite build",
88
"serve": "vite preview"
99
},
1010
"devDependencies": {
11-
"vite": "^4.0.1",
11+
"vite": "^5.0.0",
1212
"vite-plugin-restart": "workspace:*"
1313
}
14-
}
14+
}

package.json

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "vite-plugin-restart",
3+
"type": "module",
34
"version": "0.3.1",
4-
"packageManager": "pnpm@7.5.0",
5+
"packageManager": "pnpm@8.10.5",
56
"description": "Custom files/globs to restart Vite server",
67
"author": "antfu <anthonyfu117@hotmail.com>",
78
"license": "MIT",
@@ -15,16 +16,16 @@
1516
"keywords": [
1617
"vite-plugin"
1718
],
18-
"main": "dist/index.js",
19-
"module": "dist/index.mjs",
20-
"types": "dist/index.d.ts",
2119
"exports": {
2220
".": {
23-
"require": "./dist/index.js",
24-
"import": "./dist/index.mjs",
25-
"types": "./dist/index.d.ts"
21+
"types": "./dist/index.d.ts",
22+
"import": "./dist/index.js",
23+
"require": "./dist/index.cjs"
2624
}
2725
},
26+
"main": "dist/index.cjs",
27+
"module": "dist/index.js",
28+
"types": "dist/index.d.ts",
2829
"files": [
2930
"dist"
3031
],
@@ -36,22 +37,22 @@
3637
"release": "bumpp && npm publish"
3738
},
3839
"peerDependencies": {
39-
"vite": "^2.9.0 || ^3.0.0 || ^4.0.0"
40+
"vite": "^2.9.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"
4041
},
4142
"dependencies": {
4243
"micromatch": "^4.0.5"
4344
},
4445
"devDependencies": {
45-
"@antfu/eslint-config": "^0.34.0",
46-
"@antfu/ni": "^0.18.8",
47-
"@types/debug": "^4.1.7",
48-
"@types/micromatch": "^4.0.2",
49-
"@types/node": "^18.11.14",
50-
"bumpp": "^8.2.1",
51-
"eslint": "^8.29.0",
52-
"rollup": "^3.7.4",
53-
"tsup": "^6.5.0",
54-
"typescript": "^4.9.4",
55-
"vite": "^4.0.1"
46+
"@antfu/eslint-config": "^1.2.1",
47+
"@antfu/ni": "^0.21.9",
48+
"@types/debug": "^4.1.12",
49+
"@types/micromatch": "^4.0.5",
50+
"@types/node": "^20.9.1",
51+
"bumpp": "^9.2.0",
52+
"eslint": "^8.53.0",
53+
"rollup": "^4.4.1",
54+
"tsup": "^7.3.0",
55+
"typescript": "^5.2.2",
56+
"vite": "^5.0.0"
5657
}
5758
}

0 commit comments

Comments
 (0)