Skip to content

Commit a18adf2

Browse files
committed
build using tsup
1 parent 5adcbe0 commit a18adf2

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Jan T. Sott",
66
"license": "MIT",
77
"type": "module",
8-
"exports": "./dist/index.mjs",
8+
"exports": "./dist/index.js",
99
"repository": {
1010
"type": "git",
1111
"url": "git://github.com/idleberg/gulp-xml-validator.git"
@@ -18,38 +18,38 @@
1818
"xmldom"
1919
],
2020
"files": [
21-
"dist/index.mjs",
21+
"dist/",
2222
"LICENSE",
2323
"package.json",
24-
"README.MD"
24+
"README.md"
2525
],
2626
"engines": {
2727
"gulp": ">=2.3.0",
28-
"node": ">=16.13 || >=18"
28+
"node": ">=18"
2929
},
3030
"dependencies": {
31-
"@xmldom/xmldom": "^0.8.8",
31+
"@xmldom/xmldom": "^0.8.10",
3232
"kleur": "^4.1.5",
3333
"plugin-error": "^2.0.1"
3434
},
3535
"devDependencies": {
3636
"@types/node": "^20.3.3",
37-
"@types/vinyl": "^2.0.7",
38-
"@typescript-eslint/eslint-plugin": "^5.61.0",
39-
"@typescript-eslint/parser": "^5.61.0",
40-
"esbuild": "^0.18.11",
41-
"eslint": "^8.44.0",
37+
"@types/vinyl": "^2.0.9",
38+
"@typescript-eslint/eslint-plugin": "^6.9.1",
39+
"@typescript-eslint/parser": "^6.9.1",
40+
"eslint": "^8.53.0",
4241
"eslint-plugin-json": "^3.1.0",
4342
"gulp": "^4.0.2",
4443
"husky": "^8.0.3",
45-
"lint-staged": "^13.2.3",
46-
"npm-run-all2": "^6.0.5",
47-
"tslib": "^2.6.0",
48-
"typescript": "^5.1.6",
44+
"knip": "^2.39.0",
45+
"lint-staged": "^15.0.2",
46+
"npm-run-all2": "^6.1.1",
47+
"tsup": "^7.2.0",
48+
"typescript": "^5.2.2",
4949
"uvu": "^0.5.6"
5050
},
5151
"scripts": {
52-
"build": "esbuild --bundle src/index.ts --external:@xmldom/xmldom --external:kleur --external:plugin-error --format=esm --minify --outfile=dist/index.mjs --platform=node --sourcemap",
52+
"build": "tsup",
5353
"dev": "npm run build -- --watch",
5454
"lint:js": "eslint ./src/**/*.ts --ignore-path .gitignore",
5555
"lint": "npm-run-all --parallel lint:*",

tests/test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { xmlValidator } from '../dist/index.mjs';
1+
import { xmlValidator } from '../dist/index.js';
22

33
import { resolve } from 'node:path';
44
import { test } from 'uvu';

tsup.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineConfig } from 'tsup';
2+
3+
export default defineConfig({
4+
target: 'esnext',
5+
clean: true,
6+
dts: true,
7+
entry: ['src/index.ts'],
8+
external: [
9+
'@xmldom/xmldom',
10+
'kleur',
11+
'external:plugin-error'
12+
],
13+
format: 'esm',
14+
minify: true,
15+
outDir: 'dist',
16+
platform: 'node',
17+
treeshake: 'recommended'
18+
});

0 commit comments

Comments
 (0)