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

Can't change taliwind config #89

Closed
wispyco opened this issue Jun 9, 2020 · 4 comments
Closed

Can't change taliwind config #89

wispyco opened this issue Jun 9, 2020 · 4 comments

Comments

@wispyco
Copy link

wispyco commented Jun 9, 2020

I have the following config pointer to my tailwind.config.js file in my package.json

"babelMacros": {
    "twin": {
      "config":"./tailwind.config.js",
      "preset": "styled-components"
    }
  }

This is my tailwind.config

module.exports = {
  purge: [],
  theme: {
    extend: {},
    minWidth: {
      "0": "0",
      "1/4": "25%",
      "1/2": "50%",
      "3/5": "60%",
      full: "100%",
    },
  },
  variants: {},
  plugins: [],
}

When using min-w-3/5 I get a compilaiton error, but min-w-3/4 works so I think my config file isn't getting picked up. I am running gatsby and have run restarted my server and run gatsby clean, to clear the cache. Not sure what to do to get this working.

Thanks

@ben-rogerson
Copy link
Owner

ben-rogerson commented Jun 9, 2020

Everything you've posted looks fine - here's a working example with your setup

There are some known issues with Gatsby and caching, but you can defeat the cache doing the following:

  1. Make a new change in the component that's caching, this forces a fresh cache to be created

or

  1. Remove the .cache folder (npx gatsby clean)
  2. Restart your development server

When these issues are tackled, it should help minimise caching issue: #11 #37

@kmcaloon
Copy link

It's very strange. Even after cleaning cache and restarting sometimes the change don't show up. I have some custom utilities whose updates seem to never seem to show up on the frontend consistently.

@ben-rogerson
Copy link
Owner

Do you want to post some code up? I can take a look at it for you.

@ben-rogerson
Copy link
Owner

You could also try removing babel register:
rm -rf ./node_modules/.cache/@babel/register
Source

Caching is a known issue with Babel but it seems to affect Gatsby more than the other frameworks I've tested.

I'll close this issue for now, as we already have open issues for caching #11 #37

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

No branches or pull requests

3 participants