Skip to content

Commit

Permalink
fix: add "exports" to zfd package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
airjp73 committed Feb 22, 2023
1 parent 99dd9f9 commit edac362
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
13 changes: 10 additions & 3 deletions packages/zod-form-data/package.json
@@ -1,9 +1,16 @@
{
"name": "zod-form-data",
"version": "1.3.1",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"version": "2.0.0",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"license": "MIT",
"repository": {
"type": "git",
Expand Down
24 changes: 22 additions & 2 deletions packages/zod-form-data/tsup.config.ts
@@ -1,3 +1,23 @@
import { config } from "tsup-config";
import { defineConfig } from "tsup";

export default config;
export default defineConfig({
entry: ["src/index.ts"],
splitting: false,
sourcemap: true,
clean: true,
dts: true,
format: ["esm", "cjs"],
define: {
"import.meta.vitest": undefined,
} as any,
outExtension({ format }) {
switch (format) {
case "esm":
return { js: ".mjs" };
case "cjs":
return { js: ".js" };
default:
throw new Error("Unknown format");
}
},
});

0 comments on commit edac362

Please sign in to comment.