Skip to content

Commit

Permalink
Update build settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaun Lloyd committed Jan 19, 2024
1 parent 0b230de commit 8889991
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
if (module && module.hot && module.hot.decline) {
module.hot.decline()
}

// make it work with --isolatedModules
export default {}
15 changes: 10 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"incremental": false,
"isolatedModules": true,
"jsx": "react",
}
"module": "ES2022",
"moduleResolution": "node",
"rootDir": "./src",
"skipLibCheck": true,
"strict": true,
"target": "ES2022",
},
"include": ["src/**/*"],
}
11 changes: 10 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import { defineConfig } from "tsup"

export default defineConfig(() => {
export default defineConfig((options) => {
return {
dts: { entry: ["src/index.ts", "src/manager.ts", "src/preview.ts"] },
entry: ["src/index.ts", "src/manager.ts", "src/preview.ts"],
format: ["esm", "cjs"],
splitting: false,
minify: !options.watch,
treeshake: true,
sourcemap: true,
clean: true,
platform: "browser",
esbuildOptions(options) {
options.conditions = ["module"];
},
}
})

0 comments on commit 8889991

Please sign in to comment.