Skip to content

Commit e3b5cd1

Browse files
sompylasarjaredpalmer
authored andcommitted
Check path prefix with .indexOf() === 0 (#45)
`match` finds in any place of the string, but `indexOf() === 0` ensures it's at the start (the latter is the underlying intent here). Refs https://github.com/palmerhq/backpack/pull/44/files#r101360579 Refs #42
1 parent 3f07743 commit e3b5cd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/backpack-core/config/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ module.exports = (options) => {
116116
raw: true,
117117
entryOnly: false,
118118
banner: `require('${
119-
// Is source-map-support installed as project dependency, or linked?
120-
require.resolve('source-map-support').match(process.cwd())
119+
// Is source-map-support installed as project dependency, or linked?
120+
( require.resolve('source-map-support').indexOf(process.cwd()) === 0 )
121121
// If it's resolvable from the project root, it's a project dependency.
122122
? 'source-map-support/register'
123123
// It's not under the project, it's linked via lerna.

0 commit comments

Comments
 (0)