Skip to content

Commit

Permalink
Remove sourcesContent from source maps unless bundled
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Oct 2, 2023
1 parent a611295 commit aaee535
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion shared/tasks/scripts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ export async function compileJavaScript([
preserveModulesRoot: relative(basePath, srcPath),

// Enable source maps
sourcemap: true
sourcemap: true,
sourcemapExcludeSources: !!output.preserveModules
})
})
)
Expand Down
4 changes: 3 additions & 1 deletion shared/tasks/styles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export async function compileStylesheet([
*/
map: {
annotation: true,
inline: false
inline: false,
sourcesContent: false
}
}

Expand Down Expand Up @@ -114,6 +115,7 @@ export async function compileStylesheet([
// Pass source maps to PostCSS
if (typeof options.map === 'object') {
options.map.prev = map
options.map.sourcesContent = true
}
}

Expand Down

0 comments on commit aaee535

Please sign in to comment.