Skip to content

Commit

Permalink
chore(unenv-preset): drop unused .cjs files (#7697)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb authored Jan 8, 2025
1 parent 78c1649 commit 3e2bede
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 141 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

Only .mjs files are used.
14 changes: 1 addition & 13 deletions packages/unenv-preset/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
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 },
],
});
17 changes: 8 additions & 9 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 Down
Loading

0 comments on commit 3e2bede

Please sign in to comment.