-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: unify the
importModule
behavior of cjs and esm (#10)
- Loading branch information
Showing
12 changed files
with
2,467 additions
and
2,033 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { defineBuildConfig } from 'unbuild' | ||
|
||
export default defineBuildConfig({ | ||
entries: [ | ||
'src/index', | ||
'src/shared', | ||
], | ||
clean: true, | ||
declaration: true, | ||
rollup: { | ||
emitCJS: true, | ||
inlineDependencies: true, | ||
}, | ||
failOnWarn: false, | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "local-pkg", | ||
"type": "module", | ||
"version": "0.4.3", | ||
"packageManager": "[email protected]", | ||
"description": "Get information on local packages.", | ||
|
@@ -20,42 +21,49 @@ | |
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"types": "./index.d.ts", | ||
"require": "./index.cjs", | ||
"import": "./index.mjs" | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"./shared": { | ||
"types": "./dist/shared.d.ts", | ||
"import": "./dist/shared.mjs", | ||
"require": "./dist/shared.cjs" | ||
} | ||
}, | ||
"main": "index.cjs", | ||
"module": "index.mjs", | ||
"types": "index.d.ts", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"index.cjs", | ||
"index.mjs", | ||
"index.d.ts" | ||
"dist" | ||
], | ||
"engines": { | ||
"node": ">=14" | ||
}, | ||
"scripts": { | ||
"prepublishOnly": "nr build", | ||
"build": "tsup shared.ts --format esm,cjs --dts && esno scripts/postbuild.ts", | ||
"build": "unbuild", | ||
"lint": "eslint .", | ||
"release": "bumpp && npm publish", | ||
"test": "node test/cjs.cjs && node test/esm.mjs" | ||
"test": "vitest run && node ./test/cjs.cjs && node ./test/esm.mjs" | ||
}, | ||
"dependencies": { | ||
"mlly": "^1.4.2", | ||
"pkg-types": "^1.0.3" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^0.34.1", | ||
"@antfu/ni": "^0.18.8", | ||
"@antfu/utils": "^0.7.2", | ||
"@types/chai": "^4.3.4", | ||
"@types/node": "^18.11.18", | ||
"bumpp": "^8.2.1", | ||
"chai": "^4.3.7", | ||
"eslint": "^8.32.0", | ||
"esno": "^0.16.3", | ||
"@antfu/eslint-config": "^0.43.1", | ||
"@antfu/ni": "^0.21.8", | ||
"@antfu/utils": "^0.7.6", | ||
"@types/chai": "^4.3.6", | ||
"@types/node": "^20.8.0", | ||
"bumpp": "^9.2.0", | ||
"chai": "^4.3.10", | ||
"eslint": "^8.50.0", | ||
"esno": "^0.17.0", | ||
"find-up": "^6.3.0", | ||
"tsup": "^6.5.0", | ||
"typescript": "^4.9.4" | ||
"typescript": "^5.2.2", | ||
"unbuild": "^2.0.0", | ||
"vitest": "^0.34.6" | ||
} | ||
} |
Oops, something went wrong.