Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make dependencies external #977

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion esbuild.config.prod.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as esbuild from 'esbuild'
import cssModulesPlugin from 'esbuild-css-modules-plugin'
import fs from 'fs'
import pkg from './package.json' assert { type: 'json' }

const buildsConfig = [
{
Expand Down Expand Up @@ -44,6 +45,7 @@ const buildsConfig = [
minify: true,
},
]
const externals = Object.keys({ ...(pkg.peerDependencies ?? {}), ...(pkg.dependencies ?? {}) })

const builds = await Promise.all(
buildsConfig.map(({ format, outfile, minify }) =>
Expand All @@ -55,7 +57,7 @@ const builds = await Promise.all(
treeShaking: true,
minify,
sourcemap: true,
external: ['react', 'react-dom', 'prop-types'],
external: externals,
plugins: [
cssModulesPlugin({
// inject: true,
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"postcss": "8.4.21",
"prettier": "2.8.4",
"process": "^0.11.10",
"prop-types": "^15.7.2",
"react": "16.14.0",
"react-dom": "16.14.0",
"rimraf": "^3.0.2",
Expand Down Expand Up @@ -112,7 +111,7 @@
]
},
"dependencies": {
"@floating-ui/dom": "1.2.3",
"classnames": "^2.3.2"
"@floating-ui/dom": "^1.0.0",
"classnames": "^2.3.0"
}
}