Skip to content

Commit

Permalink
fix: issue with production build not loading some dependent modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaros committed Jul 29, 2024
1 parent 713a70b commit 5060c61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion storybook/src/webpack-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ function modify_internal_package_resolutions(cfg) {
const p = require(pkg)
const name = p.name

const index = fg.sync(`node_modules/${name}/src/**/index.js`, {
const pathToResolve =
process.env.NODE_ENV === 'production'
? `node_modules/${name}/build/es/**/index.js`
: `node_modules/${name}/src/**/index.js`

const index = fg.sync(pathToResolve, {
depth: 1,
onlyFiles: true,
cwd: PROJECT_ROOT,
Expand Down

0 comments on commit 5060c61

Please sign in to comment.