Skip to content

Commit 6330947

Browse files
committed
refactor!: ESM-only package, no emitting declaration maps, no including source code
1 parent 6144569 commit 6330947

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828
".": {
2929
"types": "./dist/index.d.ts",
3030
"import": "./dist/index.js",
31-
"require": "./dist/index.cjs",
3231
"default": "./dist/index.js"
3332
}
3433
},
3534
"main": "dist/index.js",
3635
"types": "dist/index.d.ts",
3736
"files": [
38-
"dist",
39-
"src"
37+
"dist"
4038
],
4139
"scripts": {
4240
"build": "rimraf ./dist && rollup -c",

rollup.config.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,17 @@ import paths from "typescript-transform-paths";
44

55
export default defineConfig({
66
input: "src/index.ts",
7-
output: [
8-
{ format: "esm", entryFileNames: "[name].js" },
9-
{ format: "cjs", entryFileNames: "[name].cjs" },
10-
].map((output) => ({
7+
output: {
8+
format: "esm",
9+
entryFileNames: "[name].js",
1110
sourcemap: true,
1211
dir: "dist",
1312
preserveModules: true,
14-
...output,
15-
})),
13+
},
1614
plugins: [
1715
typescript({
1816
include: ["./src/**"],
1917
transformers: {
20-
before: [{ type: "program", factory: paths.default }],
2118
afterDeclarations: [{ type: "program", factory: paths.default }],
2219
},
2320
}),

tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"strict": true,
1010
"noUncheckedIndexedAccess": true,
1111
"declaration": true,
12-
"declarationMap": true,
1312
"emitDeclarationOnly": true,
1413
"outDir": "dist",
1514
"sourceMap": true,

0 commit comments

Comments
 (0)