顺风版: v9.3.5
PostCSS 配置:
// postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
...(process.env.NODE_ENV === 'production'
? {
'@fullhuman/postcss-purgecss': {
content: ['./components/**/*.js', './pages/**/*.js'],
defaultExtractor: content =>
content.match(/[\w-/:]+(?<!:)/g) || [],
},
}
: {}),
},
}
Run Code Online (Sandbox Code Playgroud)
顺风配置:
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
tint: 'rgba(0,0,0,0.3)',
},
},
},
variants: {},
plugins: [],
}
Run Code Online (Sandbox Code Playgroud)
样式在开发中完美运行,但在生产中只有一些样式有效。在检查 build 文件夹中的 CSS 文件时,看起来某些 CSS 类没有被提取或可能被清除,因此导致应用程序的部分样式。
我正在使用 graphql union - union FolderOrFile = Folder | File。当我仅查询文件夹时,我得到的数组包含带有空对象的文件夹对象,这些对象基本上是文件对象。
类型定义
const typeDefs = gql`
union FolderOrFile = Folder | File
type Folder {
name: String
path: String
type: String
children: [FolderOrFile]
}
type File {
name: String
path: String
content: String
type: String
size: Int
ext: String
createdAt: String
}
type Query {
folders: Folder
}
`
Run Code Online (Sandbox Code Playgroud)
旋转变压器
const resolvers = {
FolderOrFile: {
__resolveType: obj => {
if (obj.type === "file") {
return 'File'
}
if (obj.type …Run Code Online (Sandbox Code Playgroud)