Skip to content

Commit 43abd64

Browse files
authored
Merge pull request #1837 from progfay/only-esm
publish only-ESM code
2 parents b8e7c10 + 2edbb0f commit 43abd64

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

vite.config.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
import { resolve } from "node:path";
2-
import { type LibraryFormats, defineConfig } from "vite";
3-
4-
const formats = ["es", "cjs", "umd"] satisfies LibraryFormats[];
2+
import { defineConfig } from "vite";
53

64
export default defineConfig({
75
build: {
86
emptyOutDir: false,
97
outDir: "out",
108
lib: {
11-
formats,
9+
formats: ["es"],
1210
entry: resolve(__dirname, "src/index.ts"),
13-
name: "ScrapboxParser",
14-
fileName: (format) => {
15-
switch (format) {
16-
case "cjs":
17-
return "index.cjs";
18-
case "es":
19-
return "index.mjs";
20-
case "umd":
21-
return "scrapbox-parser.umd.js";
22-
default:
23-
throw new Error(`unknown format: ${format}`);
24-
}
25-
},
11+
fileName: "index",
2612
},
2713
},
2814
});

0 commit comments

Comments
 (0)