hikamaeng
12/11/2024, 2:45 AMesbuild
.
◦ Create a folder named webpack.config.d
in the module root.
◦ Inside the folder, add a config.js
file to configure esbuild-loader
.
◦ Example configuration: https://gist.github.com/hikaMaeng/2b38fb3d0bb23e0d9dbccc2f4168af28
◦ Use npm install -g
instead of implement-npm
, as implement-npm
slows down the process during each compilation
◦ npm install --save-dev -g esbuild esbuild-loader
2. Optimize Gradle Tasks for Faster Builds
Certain Gradle tasks can be skipped after the initial build to reduce build time.
◦ Insert the following snippet into your project's build.gradle.kts
file.
◦ Comment it out during the first build.
◦ After the first successful build, uncomment it to enable faster subsequent builds.
tasks.withType<RootPackageJsonTask>().configureEach {this.enabled = false}
tasks.withType<KotlinNpmInstallTask>().configureEach {this.enabled = false}
tasks.withType<NodeJsSetupTask>().configureEach {this.enabled = false}
tasks.withType<YarnLockCopyTask>().configureEach {this.enabled = false}
tasks.withType<YarnSetupTask>().configureEach {this.enabled = false}
tasks.withType<YarnLockStoreTask>().configureEach {this.enabled = false}
3. Move more code into JavaScript and use it as an external resource.Ola Adolfsson
12/11/2024, 4:22 PMhikamaeng
12/12/2024, 2:06 AMOla Adolfsson
12/12/2024, 9:26 AMOla Adolfsson
12/12/2024, 9:27 AMhikamaeng
12/16/2024, 4:26 AMhikamaeng
12/16/2024, 4:26 AMOla Adolfsson
12/16/2024, 9:11 PMthrow exception
in the config.js file in the webpack.config.d folder.