Skip to content

Commit

Permalink
Import createElement from react in final build
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuruuh committed Mar 29, 2024
1 parent f731f5c commit 9dc9120
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: bun install --frozen-lockfile

- name: 📦 Build
run: bun run build
run: NODE_ENV=prod bun run build -m production

- name: 🔖 Release
run: npm publish
Expand Down
17 changes: 13 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"target": "ES5",
"module": "ESNext",
"jsx": "react-jsx",
"jsxImportSource": "react",
"sourceMap": true,
"outDir": "dist",
"moduleResolution": "node",
Expand All @@ -14,17 +15,25 @@
"declaration": true,
"declarationDir": "types",
"emitDeclarationOnly": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"stripInternal": true,
"types": ["bun-types"],
"types": [
"bun-types"
],
"resolveJsonModule": true,

/* Linting */
"strict": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src", ".ladle/components.tsx"]
"include": [
"src",
".ladle/components.tsx"
]
}
5 changes: 4 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export default defineConfig({
minifySyntax: true,
minifyIdentifiers: true,
jsxDev: false,
jsxImportSource: 'react',
jsxFactory: 'createElement',
jsxInject: 'import { createElement } from "react";',
jsx: 'transform',
},
build: {
Expand All @@ -18,7 +21,7 @@ export default defineConfig({
name: '@zuruuh/react-date-picker',
},
rollupOptions: {
external: [...Object.keys(packageJson.peerDependencies)],
external: Object.keys(packageJson.peerDependencies),
output: {
compact: true,
globals: {
Expand Down

0 comments on commit 9dc9120

Please sign in to comment.