Edit: I opened a new issue with Chromium.
Our project uses TypeScript compiled to JavaScript. When debugging automated unit tests in Karma, I want to disable JavaScript source maps and stick to debugging the compiled code.
I know how to do this from the browser settings but the change expires when I close the browser, so I'm looking for a way to disable it programmatically.
Disable source maps in Chrome DevTools
Chrome accepts other flags from the command line (e.g. --no-sandbox). Is there a flag or similar means to disable source maps?
Open Developer Tools, go to "Settings" for Developer Tools, then uncheck Enable JavaScript Sourcemaps under the "Sources" settings.
Right click on your "Chrome" shortcut. Choose properties. At the end of your "Target:" line add the command line flags.
It blocks several elements on websites that include tracking cookies, thus enhancing your privacy. Disabling JavaScript can break websites too, affecting the user experience. It eliminates the possibility of a hacker injecting malicious code into the web page you browse.
on webpack.config.js
add devtool: false
exports.onCreateWebpackConfig = ({ actions, stage }) => {
// If production JavaScript and CSS build
if (stage === 'build-javascript') {
// Turn off source maps
actions.setWebpackConfig({
devtool: false,
})
}
};
or
You can pass compiler options inside every loader query string
loadWhatEVer?sourceMap=false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With