Mike Digman
06/02/2023, 12:11 AM./gradlew jsBrowserProductionWebpack
or jsBrowserProductionRun
spins infinitely on the webpack step. Works with no issue with the Development variants. With Compose MPP 1.4.0 and Kotlin 1.8.20.Mike Digman
06/02/2023, 12:14 AM<============-> 96% EXECUTING [8m 6s]
> :js:jsBrowserProductionWebpack > 92% sealing asset processing TerserPlugin
Oleksandr Karpovich [JB]
06/02/2023, 9:05 AMMike Digman
06/02/2023, 11:21 PMjsBrowserProductionWebpack
on the falling-balls example works without an issue. I've tried my best to duplicate the patterns used for all the build.gradle
and gradle.properties
files - still no luck.Mike Digman
06/02/2023, 11:21 PMjsBrowserProductionWebpack
sometimes (rarely) completes and nearly instantly. My suspicion is that a prior run completed the minification but progress wasn’t updated properly. I haven’t found a consistent way to repro. Time doesn’t seem to be the magic, tried waiting 4 hours (which failed) and immediately reran (which also failed):
<============-> 96% EXECUTING [3h 50m 14s]
> :js:jsBrowserProductionWebpack > 92% sealing asset processing TerserPlugin
> IDLE
Mike Digman
06/02/2023, 11:23 PMjsBrowserDevelopmentExecutableDistribution
is now generated a .js file over that threshold.Mike Digman
06/02/2023, 11:26 PMOleksandr Karpovich [JB]
06/05/2023, 9:48 AMmodule.exports = {
//...
optimization: {
minimize: false
},
};
But it can probably produce a big js.Mike Digman
06/05/2023, 8:31 PMjsBrowserDevelopmentExecutableDistribution
) were coming out around 33mb and my jsBrowserProductionWebpack
without minification ended up being about 12mb.
In case folks run into this in the future, I did this with the following configuration:Mike Digman
06/05/2023, 8:31 PMbrowser() {
commonWebpackConfig {
configDirectory = file(".")
}
}
In file webpack.config.js in main directory:
config.optimization = { minimize: false }
Mike Digman
06/05/2023, 8:35 PM./gradlew jsBrowserProductionWebpack --info
and ./gradlew jsBrowserProductionWebpack --debug
. The output of the --info command wasn’t useful. Debug however, did show an endless file cycle of file locks and releases which might somehow be related to the underlying problem?
....
2023-06-05T09:48:30.952-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-06-05T09:48:30.952-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-06-05T09:48:30.952-0700 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on
...
Mike Digman
06/05/2023, 8:39 PMexport NODE_OPTIONS=--max_old_space_size=8192
./gradlew jsBrowserProductionWebpack
Changing webpack.config.js
from above still caused the build to hang:
const TerserPlugin = require("terser-webpack-plugin");
config.optimization = {
minimize: true,
minimizer: [new TerserPlugin({
parallel: false,
})],
}
The only functional solution so far seems to be turning off minimization entirely.Oleksandr Karpovich [JB]
06/06/2023, 9:01 AMFlo
06/29/2023, 12:20 PMChris Sinco [G]
07/25/2023, 9:51 PMIn file webpack.config.js in main directory@Mike Digman which main directory exactly? Do you have a sample project? Running into this issue now as well
Mike Digman
07/27/2023, 10:06 PMbrowser() {
commonWebpackConfig {
configDirectory = file(".")
}
}
For me that’s projectRoot / jsApp / webpack.config.js
Mike Digman
07/27/2023, 10:07 PMprojectRoot / jsApp / build.gradle.kts
Chris Sinco [G]
08/10/2023, 3:54 AMChris Sinco [G]
09/06/2023, 11:36 PMGreg Steckman
09/09/2023, 2:14 PMChris Sinco [G]
09/09/2023, 5:31 PMChris Sinco [G]
09/09/2023, 5:32 PMGreg Steckman
09/09/2023, 11:24 PMOleksandr Karpovich [JB]
10/26/2023, 11:13 AMminimize: false
, the new config makes it 2.7MB:
const TerserPlugin = require("terser-webpack-plugin");
config.optimization = config.optimization || {};
config.optimization.minimize = true;
config.optimization.minimizer = [
new TerserPlugin({
terserOptions: {
mangle: true, // Note: By default, mangle is set to true.
compress: false, // Disable the transformations that reduce the code size.
output: {
beautify: false,
},
},
}),
];
I also tried to use uglifyjs. With --compress
option it failed to complete the task too. But with --mangle
option only it produced a js file of 2.7MB tooGreg Steckman
11/12/2023, 2:22 AMLuca
04/16/2024, 4:28 AM