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

[Bug]: tailwind.config.ts config changes not applied until full restart #6464

Open
roonie007 opened this issue Oct 30, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@roonie007
Copy link

roonie007 commented Oct 30, 2024

Version

System:
  OS: Linux 5.15 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
  CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12600K
  Memory: 15.63 GB / 27.30 GB
  Container: Yes
  Shell: 5.2.21 - /bin/bash
npmPackages:
  @modern-js/app-tools: 2.60.5 => 2.60.5 
  @modern-js/plugin-tailwindcss: 2.60.5 => 2.60.5 
  @modern-js/runtime: 2.60.5 => 2.60.5 
  @modern-js/tsconfig: 2.60.5 => 2.60.5 

Details

I followed this guide to integrate Tailwindcss and it works perfectly, but the problem is when I change the content of tailwind.config.ts nothing happens, I have to manually restart the server so the changes are applied.

Here is my modern.config.ts

import { appTools, defineConfig } from "@modern-js/app-tools";
import { tailwindcssPlugin } from "@modern-js/plugin-tailwindcss";

// https://modernjs.dev/en/configure/app/usage
export default defineConfig<"rspack">({
  runtime: {
    router: true,
  },
  plugins: [appTools({ bundler: "rspack" }), tailwindcssPlugin()],
  bff: {
    enableHandleWeb: true,
  },
  server: {
    ssr: true,
    port: Number(process.env.PORT || "3000"),
  },
  dev: {
    watchFiles: [
      {
        paths: "tailwind.config.ts",
        type: "reload-server",
      },
    ],
  },
});

As you can see I even added the tailwind.config.ts file to the watchFiles but still the server is not reloaded when I save.

Reproduce link

No Need

Reproduce Steps

  1. Start a new project
  2. Add TailwindCSS
  3. Make any change to the tailwind config file and save
@roonie007 roonie007 added the bug Something isn't working label Oct 30, 2024
@roonie007
Copy link
Author

After removing the node_modules folder and reinstalling with yarn install, the file is now watched, and the server restarts correctly. However, if I make a change in the Tailwind config, like adjusting a color, the server is restarted but the changes aren’t applied until I fully restart the server.

@roonie007 roonie007 changed the title [Bug]: tailwind.config.ts is not watched [Bug]: tailwind.config.ts config changes not applied until full restart Oct 30, 2024
@zllkjc zllkjc self-assigned this Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants