Skip to content

Commit e2584da

Browse files
committed
feat: migrate to tsdown
1 parent 73dcb3e commit e2584da

File tree

5 files changed

+26
-47
lines changed

5 files changed

+26
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ node_modules
88
/test.js
99
/test/fixtures/espree-v8/node_modules
1010
/test/fixtures/integrations/**/_actual.json
11+
/dist

package.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "vue-eslint-parser",
33
"version": "10.1.4",
44
"description": "The ESLint custom parser for `.vue` files.",
5-
"main": "index.js",
5+
"main": "dist/index.js",
66
"files": [
7-
"index.*"
7+
"dist"
88
],
99
"engines": {
1010
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -39,7 +39,6 @@
3939
"@typescript-eslint/parser": "^8.22.0",
4040
"chokidar": "^3.5.2",
4141
"cross-spawn": "^7.0.3",
42-
"dts-bundle": "^0.7.3",
4342
"eslint": "^9.19.0",
4443
"eslint-plugin-eslint-comments": "^3.2.0",
4544
"eslint-plugin-jsonc": "^2.19.1",
@@ -55,18 +54,15 @@
5554
"opener": "^1.5.2",
5655
"prettier": "^3.4.2",
5756
"rimraf": "^3.0.2",
58-
"rollup": "^2.60.0",
59-
"rollup-plugin-node-resolve": "^5.2.0",
60-
"rollup-plugin-replace": "^2.2.0",
61-
"rollup-plugin-sourcemaps": "^0.6.3",
6257
"ts-node": "^10.9.2",
58+
"tsdown": "^0.12.8",
6359
"typescript": "~5.7.3",
6460
"wait-on": "^6.0.0",
6561
"warun": "^1.0.0"
6662
},
6763
"scripts": {
6864
"prebuild": "npm run -s clean",
69-
"build": "tsc --module es2015 && rollup -c -o index.js && dts-bundle --name vue-eslint-parser --main .temp/index.d.ts --out ../index.d.ts",
65+
"build": "tsdown",
7066
"clean": "rimraf .nyc_output .temp coverage index.*",
7167
"coverage": "opener ./coverage/lcov-report/index.html",
7268
"lint": "eslint src test package.json",

rollup.config.js

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

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"compileOnSave": true,
32
"compilerOptions": {
43
"allowJs": false,
54
"allowSyntheticDefaultImports": true,
@@ -8,7 +7,6 @@
87
"alwaysStrict": true,
98
"baseUrl": ".",
109
"checkJs": false,
11-
"declaration": true,
1210
"esModuleInterop": true,
1311
"forceConsistentCasingInFileNames": true,
1412
"inlineSources": true,
@@ -23,11 +21,11 @@
2321
"noImplicitThis": true,
2422
"noUnusedLocals": true,
2523
"noUnusedParameters": true,
26-
"outDir": ".temp",
2724
"paths": {
2825
"*": ["typings/*"]
2926
},
3027
"pretty": true,
28+
"resolveJsonModule": true,
3129
"removeComments": true,
3230
"sourceMap": true,
3331
"sourceRoot": "src",
@@ -37,5 +35,5 @@
3735

3836
"skipLibCheck": true
3937
},
40-
"include": ["src/**/*.ts"]
38+
"include": ["src/**/*.ts", "tsdown.config.ts"]
4139
}

tsdown.config.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { defineConfig } from "tsdown"
2+
import pkg from "./package.json"
3+
4+
export default defineConfig({
5+
entry: "./src/index.ts",
6+
target: "es2015",
7+
sourcemap: true,
8+
env: {
9+
PACKAGE_VERSION: pkg.version,
10+
},
11+
outputOptions: {
12+
banner: `/**
13+
* @author Toru Nagashima <https://github.com/mysticatea>
14+
* See LICENSE file in root directory for full license.
15+
*/`,
16+
},
17+
dts: true,
18+
format: "cjs",
19+
})

0 commit comments

Comments
 (0)