Skip to content

[Edge Case] Twin macro not working properly inside a nx workspace #351

Answered by ben-rogerson
smetzdev asked this question in Q&A
Discussion options

You must be logged in to vote

Hey there

Sounds like you'll just need a babel macros config that uses a path.resolve otherwise it'll use the run location for your scripts as the base location:

// babel-plugin-macros.config.js
const { resolve } = require("path");

module.exports = {
  twin: {
    preset: "styled-components",
    config: resolve(__dirname, "tailwind.config.js"),
  },
};

There's also a draft nx workspace pr in the twin.examples repo if you're after some more ideas.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@smetzdev
Comment options

@ben-rogerson
Comment options

@smetzdev
Comment options

Answer selected by smetzdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants