You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Create React App with Typescript, so to make the macro work in development, I have to use ES2015 export syntax in tailwind.ts:
exportdefault{// config goes here}
This, however, doesn't work in the build process. For some reason during build, the macro expects specifically the CommonJS export syntax. For now I just change it manually, but I think it's obvious why it's not ideal.
The text was updated successfully, but these errors were encountered:
Another issue with the CRA setup is that we're forced to place the config file within src, hence tempted to use variables and importing stuff that will only be defined on the browser. Since this is a compile-time config, it should be separated from runtime.
Requiring files on babel-plugin-macros.config.js is perfectly fine so I'd propose instead of -or in addition to- being able to define the file it lives at, we can provide the config object itself. This would solve both issues w/ CRA.
I use Create React App with Typescript, so to make the macro work in development, I have to use ES2015 export syntax in
tailwind.ts
:This, however, doesn't work in the build process. For some reason during build, the macro expects specifically the CommonJS export syntax. For now I just change it manually, but I think it's obvious why it's not ideal.
The text was updated successfully, but these errors were encountered: