Skip to content

Update readme.md for tailwind.config.js file #21

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

Closed
wants to merge 1 commit into from

Conversation

if1eight0sty
Copy link

configuration of tailwind.config.js for (err: require not defined)

configuration of tailwind.config for (err: require not defined)
@thecrypticace
Copy link
Contributor

@if1eight0sty What situation are you seeing this error in?

@thecrypticace thecrypticace self-assigned this Sep 15, 2023
@if1eight0sty
Copy link
Author

@thecrypticace Actually, there are not any specific situations for this.
lemme explain,
Screenshot 2023-09-15 205615
this is my project A, that uses require without any errors,
AND
Screenshot 2023-09-15 204910
this is my project B, that gives error, require is not defined. So, I have to change it to make it work
Screenshot 2023-09-15 210017

Thus, I have added an OR section in the readme for convenience, if anyone has the same issue.

@thecrypticace
Copy link
Contributor

thecrypticace commented Oct 4, 2023

Hey, so the error you were seeing in your editor is not a runtime error. It's just a linter warning because your project was configured with type: "module" which requires the use of the import syntax.

I think we're going to hold off on updating the readme right now as we'd need to do that for all our plugins, and maybe even the docs on tailwindcss.com and we don't want to do that at the moment.

We're introducing support for a simplified plugin syntax. I'm not sure what release it'll end up in but it's already usable in our insiders build — though it is currently undocumented. And, once we ship this support in a release, it is likely we'll update our plugin readme files to the new syntax.

This new syntax will support string-based plugins which we'll load instead of you having to require them. This also means you won't have to fiddle around with require or import if you don't want/need to.

An example of the new syntax:

module.exports = {
  theme: {
    // ...
  },
  plugins: [
    "@tailwindcss/container-queries",
    // ...
  ],
}

More details about this can be found here: tailwindlabs/tailwindcss#12087

With that I'm going to close this but appreciate the PR anyway. If anyone runs into a similar situation they'll may end up finding this PR anyway which should help guide them.

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants