Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KT-70029] Allow setting of configFile #5338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

omarismail94
Copy link
Contributor

The tasks:

"wasmJsBrowserDevelopmentWebpack",
"wasmJsBrowserDevelopmentRun",
"wasmJsBrowserProductionWebpack",
"wasmJsBrowserProductionRun",

of type KotlinWebpack have the same output configFile file:

projectBuildDir/js/packages/projectName-wasm-js/webpack.config.js

I want to be able to set these to different locations.

@@ -131,8 132,7 @@ constructor(
internal var resolveFromModulesFirst: Boolean = false

@get:OutputFile
open val configFile: Provider<File> =
npmProjectDir.map { it.resolve("webpack.config.js") }
abstract val configFile: RegularFileProperty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please leave configFile as is to not change type of the field?
Instead I propose to add new property configurationFile with type RegularFileProperty with convention value npmProjectDir.map { it.resolve("webpack.config.js") }.
It should look like something like that

    @get:OutputFile
    open val configurationFile: RegularFileProperty = objects.fileProperty()
        .convention(
            objects.fileProperty().fileProvider(
                npmProjectDir.map { it.resolve("webpack.config.js") }
            )
        )

And change configFile from @get:OutputFile to @get:Deprecated (because we are going to have new property as output file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants