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 Aug 23, 2023
1 parent 1bcb2a8 commit ca00c00
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 @@ -94,7 +94,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 @@ -70,7 +70,8 @@ export async function compileStylesheet([
*/
map: {
annotation: true,
inline: false
inline: false,
sourcesContent: false
}
}

Expand Down Expand Up @@ -113,6 +114,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 ca00c00

Please sign in to comment.