diff --git a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/GenerateKotlinJsBrowserWebrootForVertxWebPlugin.kt b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/GenerateKotlinJsBrowserWebrootForVertxWebPlugin.kt index 796af86..df918c7 100644 --- a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/GenerateKotlinJsBrowserWebrootForVertxWebPlugin.kt +++ b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/GenerateKotlinJsBrowserWebrootForVertxWebPlugin.kt @@ -19,15 +19,18 @@ class GenerateKotlinJsBrowserWebrootForVertxWebPlugin : Plugin { /*val jsBrowserDistributionTask by lazy { tasks.getByPath(extension.webFrontendProjectPath.get() + ":jsBrowserDistribution") as KotlinWebpack }*/ - val jsBrowserProductionWebpack by lazy { - tasks.getByPath(extension.webFrontendProjectPath.get() + ":jsBrowserProductionWebpack") as KotlinWebpack + val jsBrowserWebpack by lazy { + tasks.getByPath( + extension.webFrontendProjectPath.get() + + if (extension.production.get()) ":jsBrowserProductionWebpack" else ":jsBrowserDevelopmentWebpack" + ) as KotlinWebpack } val copyJsBrowserDistributionToResourcesWebroot = "copyJsBrowserDistributionToResourcesWebroot" val browserDistributionResourcesDirectory = buildDir.resolve("browserDistributionResources") tasks.register(copyJsBrowserDistributionToResourcesWebroot) { - dependsOn(jsBrowserProductionWebpack) - from(jsBrowserProductionWebpack.destinationDirectory) + dependsOn(jsBrowserWebpack) + from(jsBrowserWebpack.destinationDirectory) if (extension.production.get()) include("*.html", "*.css", "*.js") into(browserDistributionResourcesDirectory.resolve("webroot"))