【发布时间】:2021-07-27 08:06:51
【问题描述】:
我已经构建了一个 creat-react-app 应用程序并将其部署到 Netlify (https://festive-booth-3f3a79.netlify.app/),但正如您所见,由于某些原因,样式没有被加载。
我尝试使用 Vercel 部署应用程序,但我遇到了同样的问题。
这是我的tailwind.config.js
module.exports = {
important: true,
// Active dark mode on class basis
darkMode: "class",
i18n: {
locales: ["en-US"],
defaultLocale: "en-US",
},
purge: {
content: ["./pages/**/*.tsx", "./components/**/*.tsx"],
// These options are passed through directly to PurgeCSS
},
theme: {
extend: {},
},
variants: {
extend: {
backgroundColor: ["checked"],
borderColor: ["checked"],
inset: ["checked"],
zIndex: ["hover", "active"],
},
},
plugins: [],
future: {
purgeLayersByDefault: true,
},
};
您可以在这里查看我拥有的所有其他文件:https://gitlab.com/lucas.distasi/react-tmdb
在yarn run build 之后创建的构建文件夹中使用yarn start 在我的本地运行完全正常。所以我猜这是在远程服务器上部署时 Tailwind CSS 文件的问题。
【问题讨论】:
标签: create-react-app tailwind-css netlify vercel