使用 Nuxt v2.15.8 + Tailwind。在 npm run dev 和每次刷新之后使用的所有文件中都会发出有关嵌套的警告,例如
Run Code Online (Sandbox Code Playgroud)WARN in ./components/Cabinet/CabinetSidebar/CabinetSidebarMenu.vue?vue&type=style&index=0&lang=postcss&友好错误 18:24:59
Run Code Online (Sandbox Code Playgroud)Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):友好错误 18:24:59 警告
Run Code Online (Sandbox Code Playgroud)(99:2) Nested CSS was detected, but CSS nesting has not been configured correctly. Please enable a CSS nesting plugin *before* Tailwind in your configuration. See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting
文件 nuxt.config.js
import 'reflect-metadata'
import { join } from 'path'
const isProd = process.env.NODE_ENV === 'production'
export default {
head: {...},
css: ['~assets/css/styles.css'],
loading: false,
components: {
dirs: ['~/components', '~/components/Base'],
}, …Run Code Online (Sandbox Code Playgroud)