Skip to content

Commit

Permalink
fix: fix the default export for cjs output (mammadataei#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mammadataei committed Oct 20, 2022
1 parent cc0b5fd commit a1822a9
Show file tree
Hide file tree
Showing 5 changed files with 841 additions and 224 deletions.
10 changes: 10 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: ['src/index'],
declaration: true,
clean: true,
rollup: {
emitCJS: true,
},
})
2 changes: 1 addition & 1 deletion example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": ["cypress", "@testing-library/cypress"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"bugs": {
"url": "https://github.com/mammadataei/cypress-vite/issues"
},
"main": "dist/index.js",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
Expand All @@ -31,7 +31,7 @@
"dist"
],
"scripts": {
"build": "tsup",
"build": "unbuild",
"example": "pnpm --filter example",
"test": "pnpm --filter example test",
"format": "prettier --write . && pnpm lint --fix",
Expand Down Expand Up @@ -60,8 +60,8 @@
"lint-staged": "^13.0.3",
"prettier": "2.6.2",
"rollup": "2.78.1",
"tsup": "^6.2.3",
"typescript": "^4.8.3",
"unbuild": "^0.9.4",
"vite": "^3.1.3"
},
"dependencies": {
Expand Down
Loading

0 comments on commit a1822a9

Please sign in to comment.