Closed fawwaz closed 3 years ago
Have you tried disabling purge completely to see if it would make it work? Because it looks more like an issue in your setup than an issue with ntm.
I tried. Yes, removing purge option loads the entire CSS, but it also means the objective of purge CSS is not achieved as it also loads any irrelevant CSS rules.
I think I should rephrase the question : how can I set the webpack option(purge CSS option) so it will purge the CSS from local module ?
Well then it's not exactly related to next-transpile-modules
, it's really just about applying purge to your packages in node_modules
.
If I had to look somewhere, I'd check your tailwind config and add a glob there:
purge: [
"./pages/**/*.{js.ts,tsx,jsx}",
"./components/**/*.{js.ts,tsx,jsx}",
"web-ui/**/*.{js.ts,tsx,jsx}"
]
No idea if it will work, but you can play with require.resolve
to get the path to your package as well, but it's definitely where it should be fixed.
Are you trying to transpile a local package or an npm package? If an npm package, which one? Local Package
Describe the bug A clear and concise description of what the bug is (don't forget the logs if applicable). I created a monorepo setup using lerna. I plan to have 2 packages:
yarn dev
) the tailwind styling is applied (the component that is located within web-ui is styled correctly). However, when I run for production build (yarn build
) the tailwind styling is missing (I guess it is purged (?))To Reproduce Steps to reproduce the behavior (a reproduction is even better):
packages/web-app
packages/web-app
Expected behavior A clear and concise description of what you expected to happen.
Running production build should include the tailwind styling.
Setup
next-transpile-modules
version: 7.2.0npm
/yarn
version: 1.22.10Additional context Add any other context about the problem here.