Skip to content

Commit

Permalink
add main build/cjs exports
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Aug 17, 2023
1 parent ea3318d commit eb3e09d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-buckets-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"codemirror-json-schema": patch
---

Add main/cjs exports for webpack
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
cjs
/public
coverage
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"packageManager": "pnpm@8.6.6",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"main": "cjs/index.js",
"files": [
"dist",
"README.md",
Expand All @@ -35,11 +36,15 @@
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
"types": "./dist/index.d.ts",
"require": "./cjs/index.js",
"default": "./cjs/index.js"
},
"./json5": {
"import": "./dist/json5.js",
"types": "./dist/json5.d.ts"
"types": "./dist/json5.d.ts",
"require": "./cjs/json5.js",
"default": "./cjs/json5.js"
}
},
"repository": "github:acao/codemirror-json-schema",
Expand Down Expand Up @@ -84,7 +89,7 @@
},
"scripts": {
"dev": "vite ./dev --port 3000",
"build": "pnpm tsc && vite build ./dev --outDir ../public --emptyOutDir",
"build": "pnpm tsc && tsc --module commonjs --target es2017 --outDir cjs && vite build ./dev --outDir ../public --emptyOutDir",
"test": "vitest --dom",
"test:coverage": "vitest run --dom --coverage ",
"tsc": "tsc && pnpm replace:env",
Expand Down

0 comments on commit eb3e09d

Please sign in to comment.