Skip to content

Commit

Permalink
chore: fix existing "/build" check
Browse files Browse the repository at this point in the history
Locally, when running a prebuild, no package.json is generated. Therefore, we should check for an index file instead.
  • Loading branch information
tujoworker committed Jun 14, 2023
1 parent 5f59c50 commit fbaeb6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/dnb-design-system-portal/src/core/BuildTools.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const fs = require('fs-extra')
function shouldUsePrebuild() {
const rootPath = path.dirname(require.resolve('@dnb/eufemia'))
const buildPath = path.resolve(rootPath, 'build')
const packageJsonPath = path.resolve(buildPath, 'package.json')
const prebuildExists = fs.existsSync(packageJsonPath)
const packageIndex = path.resolve(buildPath, 'index.js')
const prebuildExists = fs.existsSync(packageIndex)

return Boolean(prebuildExists && process.env.NODE_ENV === 'production')
}
Expand Down

0 comments on commit fbaeb6d

Please sign in to comment.