Skip to content

Requiring jit-refresh.css breaks some automated builds #3

Open
@christopher-b

Description

@christopher-b

The installation process for this automation creates the file frontend/styles/jit-refresh.css, and adds that file to .gitignore. If a build process is being run in a CI environment, or using something like Kamal which checks out a fresh copy of the repo, the jit-refresh.css file will not be present in that build environment, and the @import statement referencing this file will fail. A frontend build process will complete successfully (the exit code will be zero), but an error will be emitted:

> node esbuild.config.js --minify

esbuild: frontend bundling started...

error: "undefined" while processing CSS file:
undefined:undefined:undefined

esbuild: frontend bundling complete!
esbuild: entrypoints processed:
         - index.P6KJZRZR.js: 113B
         - index.DYSKJ26J.css: 3.9KB

Any CSS below the line @import "jit-refresh.css"; will not be included in the build artifacts, which in this case is... all of Tailwind 😁

One workaround in to include touch frontend/styles/jit-refresh.css in the build process, before building the frontend.

I wonder if there is another way to trigger Tailwind's JIT in development that doesn't break a build in a fresh checkout of the repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions