问题描述
我遵循了 Styled-jsx 的官方文档 在样式标签中使用和导入常规 css 文件。但 之后,我无法在我的项目中使用 tailwind css。请帮忙 网络包配置
webpack: (config,{ defaultLoaders }) => {
config.module.rules.push({
test: /\.(css|scss)$/,use: [
defaultLoaders.babel,{
loader: require("styled-jsx/webpack").loader,options: {
type: (fileName,options) => options.query.type || 'scoped'
},},],});
return config;
},
示例用法:
import Style from "../styles/globals.css?type=global"; // this is working
import "tailwindcss/tailwind.css" // this is not working
function MyApp({ Component,pageProps }) {
return (
<>
<Component {...pageProps} />
<style jsx>{Style}</style>
</>
);
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)