Hello! How to skip obfuscation in production JS ge...
# javascript
p
Hello! How to skip obfuscation in production JS generated code?
t
Create following file (
patch.js
for example) in
webpack.config.d
folder:
Copy code
if (config.mode === 'production') {
  // disable obfuscation
}
p
Hello Victor! Actually I need to know what flags to set in kotlin compiler to disable obfuscation step.
i
Hi, do you us
browser
subtarget in gradle plugin?
p
Hello, @Ilya Goncharov [JB]! Yes.
i
Obfuscation is feature not of compiler, but webpack - tool for bundling all your js code into one bug file. To disable it you can use for example
browserDevelopmentWebpack
instead of
browserProductionWebpack
, but it disable DCE too. If you want to leave DCE but disable minification, you can set mode to
DEVELOPMENT
Copy code
webpackTask {
    mode = DEVELOPMENT // import will be required
}
p
Thank you!