Skip to content

Commit 058fc58

Browse files
authored
feat: switch to ESM-only (#1411)
Switches the 3 remaining dual packages to ESM only: - `parse5-htmlparser2-tree-adapter` - `parse5-parser-stream` - `parse5`
1 parent 1a4539e commit 058fc58

File tree

7 files changed

+31
-26
lines changed

7 files changed

+31
-26
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"vitest": "^3.0.1"
2626
},
2727
"scripts": {
28-
"build": "npm run build:esm && npm run build:cjs --workspaces --if-present",
29-
"build:esm": "tsc --build packages/* test",
28+
"build": "tsc --build packages/* test",
3029
"build:docs": "typedoc",
3130
"prettier": "prettier '**/*.{js,ts,md,json,yml}' --log-level warn",
3231
"format": "npm run format:es && npm run format:prettier",

packages/parse5-html-rewriting-stream/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
"main": "dist/index.js",
2121
"module": "dist/index.js",
2222
"types": "dist/index.d.ts",
23-
"exports": "./dist/index.js",
23+
"exports": {
24+
".": {
25+
"default": "./dist/index.js"
26+
}
27+
},
2428
"dependencies": {
2529
"entities": "^6.0.0",
2630
"parse5": "^7.0.0",

packages/parse5-htmlparser2-tree-adapter/package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,24 @@
1414
"htmlparser2"
1515
],
1616
"license": "MIT",
17-
"main": "dist/cjs/index.js",
17+
"main": "dist/index.js",
1818
"module": "dist/index.js",
1919
"types": "dist/index.d.ts",
2020
"exports": {
21-
"import": "./dist/index.js",
22-
"require": "./dist/cjs/index.js"
21+
".": {
22+
"default": "./dist/index.js"
23+
}
2324
},
2425
"dependencies": {
2526
"domhandler": "^5.0.3",
2627
"parse5": "^7.0.0"
2728
},
28-
"scripts": {
29-
"build:cjs": "tsc --noCheck --moduleResolution node10 --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"
30-
},
29+
"scripts": {},
3130
"repository": {
3231
"type": "git",
3332
"url": "git://github.com/inikulin/parse5.git"
3433
},
3534
"files": [
36-
"dist/cjs/package.json",
3735
"dist/**/*.js",
3836
"dist/**/*.d.ts"
3937
]

packages/parse5-parser-stream/package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,23 @@
1414
"streaming"
1515
],
1616
"license": "MIT",
17-
"main": "dist/cjs/index.js",
17+
"main": "dist/index.js",
1818
"module": "dist/index.js",
1919
"types": "dist/index.d.ts",
2020
"exports": {
21-
"import": "./dist/index.js",
22-
"require": "./dist/cjs/index.js"
21+
".": {
22+
"default": "./dist/index.js"
23+
}
2324
},
2425
"dependencies": {
2526
"parse5": "^7.0.0"
2627
},
27-
"scripts": {
28-
"build:cjs": "tsc --noCheck --moduleResolution node10 --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"
29-
},
28+
"scripts": {},
3029
"repository": {
3130
"type": "git",
3231
"url": "git://github.com/inikulin/parse5.git"
3332
},
3433
"files": [
35-
"dist/cjs/package.json",
3634
"dist/**/*.js",
3735
"dist/**/*.d.ts"
3836
]

packages/parse5-plain-text-conversion-stream/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
"main": "dist/index.js",
2121
"module": "dist/index.js",
2222
"types": "dist/index.d.ts",
23-
"exports": "./dist/index.js",
23+
"exports": {
24+
".": {
25+
"default": "./dist/index.js"
26+
}
27+
},
2428
"dependencies": {
2529
"parse5": "^7.0.0",
2630
"parse5-parser-stream": "^7.0.0"

packages/parse5-sax-parser/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
"main": "dist/index.js",
1919
"module": "dist/index.js",
2020
"types": "dist/index.d.ts",
21-
"exports": "./dist/index.js",
21+
"exports": {
22+
".": {
23+
"default": "./dist/index.js"
24+
}
25+
},
2226
"dependencies": {
2327
"parse5": "^7.0.0"
2428
},

packages/parse5/package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,20 @@
2828
"serialize"
2929
],
3030
"license": "MIT",
31-
"main": "dist/cjs/index.js",
31+
"main": "dist/index.js",
3232
"module": "dist/index.js",
3333
"types": "dist/index.d.ts",
3434
"exports": {
35-
"import": "./dist/index.js",
36-
"require": "./dist/cjs/index.js"
37-
},
38-
"scripts": {
39-
"build:cjs": "tsc --noCheck --moduleResolution node10 --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"
35+
".": {
36+
"default": "./dist/index.js"
37+
}
4038
},
39+
"scripts": {},
4140
"repository": {
4241
"type": "git",
4342
"url": "git://github.com/inikulin/parse5.git"
4443
},
4544
"files": [
46-
"dist/cjs/package.json",
4745
"dist/**/*.js",
4846
"dist/**/*.d.ts"
4947
]

0 commit comments

Comments
 (0)