Skip to content

Commit

Permalink
feat(htmlparser2-adapter): Add CJS build (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 committed Apr 12, 2022
1 parent f854f04 commit 7b1401a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -25,9 +25,8 @@
"typescript": "^4.6.3"
},
"scripts": {
"build": "npm run build:esm && npm run build:cjs",
"build": "npm run build:esm && npm run build:cjs --workspaces --if-present",
"build:esm": "tsc --build packages/* test",
"build:cjs": "tsc -p packages/parse5/tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > packages/parse5/dist/cjs/package.json",
"build:docs": "node --max-old-space-size=8192 node_modules/.bin/typedoc .",
"prettier": "prettier '**/*.{js,ts,md,json,yml}' --loglevel warn",
"format": "npm run format:es && npm run format:prettier",
Expand Down
10 changes: 8 additions & 2 deletions packages/parse5-htmlparser2-tree-adapter/package.json
Expand Up @@ -14,14 +14,20 @@
"htmlparser2"
],
"license": "MIT",
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": "./dist/index.js",
"exports": {
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
},
"dependencies": {
"domhandler": "^4.3.1",
"parse5": "^6.0.1"
},
"scripts": {
"build:cjs": "tsc --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"
},
"repository": {
"type": "git",
"url": "git://github.com/inikulin/parse5.git"
Expand Down
9 changes: 5 additions & 4 deletions packages/parse5/package.json
Expand Up @@ -32,10 +32,11 @@
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
}
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
},
"scripts": {
"build:cjs": "tsc --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"
},
"repository": {
"type": "git",
Expand Down
8 changes: 0 additions & 8 deletions packages/parse5/tsconfig.cjs.json

This file was deleted.

0 comments on commit 7b1401a

Please sign in to comment.