Skip to content

Commit

Permalink
chore(unenv-preset): drop unused .cjs files
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed Jan 8, 2025
1 parent e4716cc commit 37a46c6
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 144 deletions.
7 changes: 7 additions & 0 deletions .changeset/nervous-scissors-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@cloudflare/unenv-preset": minor
---

chore(unenv-preset): drop unused .cjs files

Ony .esm files are used.
17 changes: 3 additions & 14 deletions packages/unenv-preset/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
import { defineBuildConfig } from "unbuild";


export default defineBuildConfig({
declaration: true,
rollup: {
emitCJS: true,
},
entries: [
"src/index",
{ input: "src/runtime/", outDir: "dist/runtime", format: "esm" },
{
input: "src/runtime/",
outDir: "dist/runtime",
format: "cjs",
ext: "cjs",
declaration: false,
},
{ input: "src/", outDir: "dist/src", format: "esm", declaration: true },
],
});
});
21 changes: 10 additions & 11 deletions packages/unenv-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,21 @@
},
"license": "MIT OR Apache-2.0",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.mjs"
},
"./runtime/*": {
"types": "./dist/runtime/*.d.ts",
"require": "./dist/runtime/*.cjs",
"import": "./dist/runtime/*.mjs"
"types": "./dist/src/runtime/*.d.ts",
"import": "./dist/src/runtime/*.mjs"
}
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"main": "./dist/src/index.mjs",
"types": "./dist/src/index.d.ts",
"files": [
"dist"
"dist/src"
],
"scripts": {
"build": "unbuild",
Expand All @@ -45,8 +44,8 @@
},
"devDependencies": {
"@types/node": "*",
"typescript": "catalog:default",
"unbuild": "^2.0.0"
"unbuild": "^2.0.0",
"typescript": "catalog:default"
},
"peerDependencies": {
"unenv": "npm:unenv-nightly@*",
Expand Down
Loading

0 comments on commit 37a46c6

Please sign in to comment.