Skip to content

Commit

Permalink
fix: tsup build esm import ReleaseType error (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
dockfries committed Jan 17, 2024
1 parent 5d8d761 commit 615001b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/release-type.ts
@@ -1,6 +1,6 @@
import { ReleaseType } from 'semver'
import type { ReleaseType } from 'semver'

export { ReleaseType }
export type { ReleaseType }

/**
* The different types of pre-releases.
Expand Down
11 changes: 11 additions & 0 deletions tsup.config.ts
@@ -0,0 +1,11 @@
import { defineConfig } from "tsup";

export default defineConfig({
banner: ({ format }) => {
if (format === "esm") {
return {
js: "import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);",
};
}
},
});

0 comments on commit 615001b

Please sign in to comment.