nanodeath / kotlinjs-tailwindcss

Sample application and instructions for using Tailwind CSS with a full-stack Kotlin JS application.
42 stars 2 forks source link

Updates to this repo #1

Open CLOVIS-AI opened 3 years ago

CLOVIS-AI commented 3 years ago

I followed your steps, and a few small things have changed:

Also, this procedure does not work (or at least I didn't manage to make it work) with the legacy compiler.

Thanks a lot for your help, there's really not much documentation, I wouldn't have managed it otherwise. Here's the merge request in which I implemented the changes, if you want more details.

nanodeath commented 3 years ago

Hi @CLOVIS-AI, thanks for checking out my project.

Obviously, the versions of the tools

I've pushed an update of the tools.

kotlin-extensions is no longer necessary

I'm not seeing this -- if I remove kotlin-extensions, kotlinext.js.require no longer resolves.

When using multi-module projects, a 'copy' task is necessary so Webpack can see the tailwind/postcss configurations

Good to know...

Your workaround at the end of the README is no longer necessary

Which workaround? The section titled "Modifications to app.css"? Seems like it still is; if I remove that line, my app.css changes still don't get picked up without running a clean first.

Continuous build works!

Seems like it's still broken for me -- updating app.css doesn't trigger anything, so I have to restart the build.

Nikola-Milovic commented 2 years ago

@nanodeath @CLOVIS-AI have either of you gotten Plugins to work with either of your setups?

I get Module build failed (from ./node_modules/postcss-loader/dist/cjs.js): Error: Cannot find module 'tailwindcss/plugin' everytime

My setup is simply

    variants: {
        extend: {},
    },
    plugins: [require('tailwind-scrollbar-hide')],

And added this as my dep implementation(npm("tailwind-scrollbar-hide", "1.0.3")) Should be alright from the setup perspective, guessing something with the way KotlinJs resolves deps and such is causing the issue.

skrugly commented 2 years ago

@CLOVIS-AI Thanks for the link! I've got it working with your help.

These lines are necessary to make it work:

val copyTailwindConfig = tasks.register<Copy>("copyTailwindConfig") {
    from("./tailwind.config.js")
    into("${rootProject.buildDir}/js/packages/${rootProject.name}-${project.name}")

    dependsOn(":kotlinNpmInstall")
}

val copyPostcssConfig = tasks.register<Copy>("copyPostcssConfig") {
    from("./postcss.config.js")
    into("${rootProject.buildDir}/js/packages/${rootProject.name}-${project.name}")

    dependsOn(":kotlinNpmInstall")
}

tasks.named("processResources") {
    dependsOn(copyTailwindConfig)
    dependsOn(copyPostcssConfig)
}