[Gradle, JS] Webpack catch files from js compilations
This commit is contained in:
+10
@@ -94,6 +94,11 @@ open class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
|
||||
it.bin = "webpack-dev-server/bin/webpack-dev-server.js"
|
||||
it.compilation = compilation
|
||||
it.entry = getByKind(
|
||||
kind,
|
||||
compilation.productionLinkTask.outputFile,
|
||||
compilation.developmentLinkTask.outputFile
|
||||
)
|
||||
it.description = "start ${kind.name.toLowerCase()} webpack dev server"
|
||||
|
||||
it.devServer = KotlinWebpackConfig.DevServer(
|
||||
@@ -162,6 +167,11 @@ open class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
it.configureOptimization(kind)
|
||||
|
||||
it.compilation = compilation
|
||||
it.entry = getByKind(
|
||||
kind,
|
||||
compilation.productionLinkTask.outputFile,
|
||||
compilation.developmentLinkTask.outputFile
|
||||
)
|
||||
it.description = "build webpack ${kind.name.toLowerCase()} bundle"
|
||||
it.destinationDirectory = distribution.directory
|
||||
|
||||
|
||||
+6
-1
@@ -49,7 +49,12 @@ abstract class KotlinJsIrSubTarget(
|
||||
|
||||
target.compilations.all {
|
||||
val npmProject = it.npmProject
|
||||
it.compileKotlinTask.kotlinOptions.outputFile = npmProject.dir.resolve(npmProject.main).canonicalPath
|
||||
listOf(
|
||||
it.productionLinkTask,
|
||||
it.developmentLinkTask
|
||||
).forEach { task ->
|
||||
task.kotlinOptions.outputFile = npmProject.dir.resolve(npmProject.main).canonicalPath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user