[Edge Case] Twin macro not working properly inside a nx workspace #351
-
Hello, i have an issue inside an nx workspace. Twin.macro itself works like a breeze, but it does not seem to work with my tailwind.config.js Currently the tailwind.config.js is based in the root of my nx workspace, but it also does not work if i put it in the folder of a single app for example. What would you do here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
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. |
Beta Was this translation helpful? Give feedback.
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:
There's also a draft nx workspace pr in the twin.examples repo if you're after some more ideas.