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

Tailwind does not work in new workspace with React, No React Framework, Rspack, Tailwind setup #27028

Closed
1 of 4 tasks
sirajc opened this issue Jul 21, 2024 · 2 comments · Fixed by #27619
Closed
1 of 4 tasks

Comments

@sirajc
Copy link

sirajc commented Jul 21, 2024

Current Behavior

Create a new Nx workspace, Select React, No React Framework, Rspack, Tailwind
Tailwind setup does not work

Create a new Nx workspace, Select React, No React Framework, Webpack, Tailwind
Tailwind setup works

Going through manual setup as mentioned in nx.dev didn't helped either.

Expected Behavior

Tailwind should work with Rspack & React

GitHub Repo

No response

Steps to Reproduce

Create a new Nx workspace, Select React, No React Framework, Rspack, Tailwind
Tailwind setup does not work

Nx Report

Node   : 18.16.0
OS     : darwin-arm64
npm    : 9.5.1

nx (global)        : 19.5.1
nx                 : 19.5.1
@nx/js             : 19.5.1
@nx/jest           : 19.5.1
@nx/linter         : 19.5.1
@nx/eslint         : 19.5.1
@nx/workspace      : 19.5.1
@nx/cypress        : 19.5.1
@nx/devkit         : 19.5.1
@nx/eslint-plugin  : 19.5.1
@nx/playwright     : 19.5.1
@nx/react          : 19.5.1
@nrwl/tao          : 19.5.1
@nx/web            : 19.5.1
typescript         : 5.5.3
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/playwright/plugin
@nx/jest/plugin
---------------------------------------
Community plugins:
@nx/rspack : 19.2.0

Failure Logs

No Logs or error

Package Manager Version

npm 9.5.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Tailwind docs suggest postcss-loader in configuration for rspack which is missing in @nx/rspack + @nx/react combo

https://tailwindcss.com/docs/guides/rspack

@semanticist21
Copy link

semanticist21 commented Jul 31, 2024

Rspack.config.js should be like this!
Afte runnig install command pnpm i -D postcss-loader, editted

module.exports = composePlugins(withNx(), withReact(), (config) => { return { ...config, module: { rules: [ ...config.module.rules, { test: /\.css$/, use: ['postcss-loader'], type: 'css', }, ], }, }; });

Coly010 added a commit that referenced this issue Aug 23, 2024
…7619)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
React, Tailwind and Rspack is not working out of the box


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
It works out of the box.

In tandem with nrwl/nx-labs#415


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27028
FrozenPandaz pushed a commit that referenced this issue Aug 26, 2024
…7619)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
React, Tailwind and Rspack is not working out of the box

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
It works out of the box.

In tandem with nrwl/nx-labs#415

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27028

(cherry picked from commit add4183)
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants