https://kotlinlang.org logo
#javascript
Title
# javascript
c

Cheick Kante

02/25/2023, 9:28 PM
How does one disable Sourcemap on a Kotlin (JVM & JS) project ? I'm looking to disable sourcemap on my production Jar, but I keep seeing the source map in the browser even after the following gradle configs
Copy code
...
binaries.executable()
browser {


    runTask {
        mode = Mode.PRODUCTION

    }

    webpackTask {
        sourceMaps = false


    }
    commonWebpackConfig {
        sourceMaps = false
        cssSupport { enabled = true }
        mode = Mode.PRODUCTION
    }
}
...
z

Zachary Siegel

02/25/2023, 9:38 PM
thats interesting. ive never used a jvm-based webserver, but in a node environment, source maps arent enabled by default
c

Cheick Kante

02/25/2023, 9:46 PM
Hey Zachary, thanks for looking into this. I just happened to find the culprit ! I had a webpack-config.js file with this content
Copy code
module.exports = {
        mode: 'development',

    }
Didn't matter what I put in Gradle as this file was overriding Gradle's settings. Upon removing the file or switching the mode, the sourceMap effectively disappeared out of the browser. PROBLEM SOLVED
39 Views