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 have a couple css module imports from 3rd party libraries (i.e. tailwind and fontsource) which are causing issues in my next.js app when I import my lib.
error - ./node_modules/tailwindcss/tailwind.css
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
output-filename.cjs.development.js
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var React = require('react');
var React__default = _interopDefault(React);
require('tailwindcss/tailwind.css'); // << next.js complains
require('@fontsource/titillium-web/index.css'); // << next.js complains
...
Is there a way to configure tsdx to change these to import local built css files? I have tried adding extract: true to postcss config but it doesn't seem to generate everything properly (all the styles are missing in the .css file) and it doesn't change the way the js imports the css.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a couple css module imports from 3rd party libraries (i.e. tailwind and fontsource) which are causing issues in my next.js app when I import my lib.
output-filename.cjs.development.js
Is there a way to configure tsdx to change these to import local built css files? I have tried adding
extract: true
to postcss config but it doesn't seem to generate everything properly (all the styles are missing in the .css file) and it doesn't change the way the js imports the css.Beta Was this translation helpful? Give feedback.
All reactions