Skip to content

Commit 7941870

Browse files
authored
fix(highlight-vdom): remove UMD entry points and add CommonJS (#7)
1 parent 03bd699 commit 7941870

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Diff for: babel.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = (api) => {
22
const isTest = api.env('test');
3-
const modules = isTest ? 'commonjs' : false;
3+
const isCjs = api.env('cjs');
4+
const modules = isTest || isCjs ? 'commonjs' : false;
45
const targets = {};
56

67
if (isTest) {

Diff for: packages/highlight-vdom/package.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
"source": "src/index.ts",
1212
"types": "dist/esm/index.d.ts",
1313
"module": "dist/esm/index.js",
14-
"main": "dist/umd/index.js",
15-
"umd:main": "dist/umd/index.js",
16-
"unpkg": "dist/umd/index.js",
17-
"jsdelivr": "dist/umd/index.js",
14+
"main": "dist/cjs/index.js",
1815
"sideEffects": false,
1916
"files": [
2017
"dist/"
@@ -23,7 +20,8 @@
2320
"build:clean": "rm -rf ./dist",
2421
"build:esm": "babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/esm --ignore '**/*/__tests__/'",
2522
"build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/esm",
26-
"build": "yarn build:clean && yarn build:esm && yarn build:types",
23+
"build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/cjs --ignore '**/*/__tests__/'",
24+
"build": "yarn build:clean && yarn build:esm && yarn build:cjs && yarn build:types",
2725
"prepare": "yarn build:esm && yarn build:types"
2826
},
2927
"dependencies": {

0 commit comments

Comments
 (0)