Skip to content

Commit 5ccbe25

Browse files
committed
Fix an issue where source maps weren't loaded for library projects
1 parent bccec15 commit 5ccbe25

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

rigs/heft-web-rig/shared/webpack-base.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ function createWebpackConfig({ env, argv, projectRoot, configOverride }) {
3838
// processing as per a chosen source map style specified by the devtool option in webpack.config.js.
3939
// https://www.npmjs.com/package/source-map-loader
4040
test: /\.js$/,
41-
include: [path.resolve(projectRoot, 'lib')],
41+
42+
// Include source maps from other library projects in the monorepo workspace,
43+
// but exclude source maps for external NPM packages. Webpack tests the fs.realPathSync() path,
44+
// so external packages will be under "common/temp/node_modules/.pnpm/".
45+
exclude: /[\\/]\.pnpm[\\/]/,
46+
4247
enforce: 'pre',
4348
use: [
4449
{

0 commit comments

Comments
 (0)