Skip to content

Commit

Permalink
fix: make react and react-dom external
Browse files Browse the repository at this point in the history
  • Loading branch information
ttttonyhe committed Jul 30, 2023
1 parent 2bd411c commit 4ece0d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/twilight-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@
"description": "A super opinionated UI library for React & Tailwind CSS",
"license": "SEE LICENSE IN LICENSE",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
},
"files": [
"/dist",
"LICENSE",
Expand All @@ -30,6 +22,10 @@
"upgrade": "ncu --upgrade",
"prepublishOnly": "turbo run build"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/preset-env": "^7.21.4",
Expand All @@ -55,9 +51,7 @@
"eslint-plugin-storybook": "^0.6.13",
"http-server": "^14.1.1",
"postcss": "^8.4.27",
"react": "^18.2.0",
"react-docgen-typescript-plugin": "^1.0.5",
"react-dom": "^18.2.0",
"storybook": "^7.1.1",
"storybook-addon-turbo-build": "^2.0.1",
"storybook-dark-mode": "^3.0.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/twilight-ui/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { sassPlugin } from "esbuild-sass-plugin"
import postcss from "postcss"
import autoprefixer from "autoprefixer"
import tailwind from "tailwindcss"
import { dependencies } from "../package.json"

const isDevelopment = process.env.NODE_ENV === "development"

Expand All @@ -25,6 +26,7 @@ const ESBUILD_CONFIG: BuildOptions = {
platform: "browser",
metafile: true,
format: "esm",
external: Object.keys(dependencies),
plugins: [
sassPlugin({
// TailwindCSS
Expand Down

0 comments on commit 4ece0d6

Please sign in to comment.