निर्माण Next.JS और tailwindcss

0

सवाल

मैं का उपयोग TailwindCSS और NextJs के लिए app है । सब कुछ काम कर रहा है जब मैं npm run dev लेकिन जब मैं npm run build तो npm run start मैं कुछ वर्गों है कि काम नहीं कर रहे हैं. उदाहरण के लिए इस कोड में, h-20 / text-white काम नहीं, लेकिन अन्य tailwind वर्गों रहे हैं, पूरी तरह से काम...

<div class="flex text-white font-semibold cursor-pointer">
<div class="flex-1 h-20 center-hv text-center bg-blue-primary hover:bg-blue-hover button-shadow">
    <div>
        <div>Acheter 200 €</div>
    </div>
</div> 
</div>

वहाँ मेरा confs :

//next.config.js

module.exports = {
    images: {
      domains: ["picsum.photos"],
    },
    env: {
      customKey: 'my-value',
    }
  }
//postcss.config.js

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
}
//tailwind.css

module.exports = {
  purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {
      backgroundColor: theme => ({
        ...theme('colors'),
        'blue-primary': '#A9C4D2',
        'blue-secondary': '#bbd9e8',
        'blue-hover': '#74afcd',
        'alert-info': '#d5e9f3',
        'alert-warning': '#ffd585',
        'alert-danger': '#ffb3b3'
      }),
      textColor: theme => ({
        ...theme('colors'),
        'blue-primary': '#A9C4D2',
        'blue-secondary': '#bbd9e8',
        'blue-hover': '#74afcd',
        'alert-info': '#d5e9f3',
        'alert-warning': '#ffd585',
        'alert-danger': '#ffb3b3'
      }),
    },
    flex: {
      '1': '1 1 0%',
      '2': '2 2 0%',
      '3': '3 3 0%',
      '4': '4 4 0%',
      '5': '5 5 0%',
      auto: '1 1 auto',
      initial: '0 1 auto',
      inherit: 'inherit',
      none: 'none',
    }
  },
  variants: {
    extend: {},
  },
  plugins: [],
}
//jsconfig.json

{
    "typeAcquisition": {
        "include": ["jest"]
    }
}
//_app.js

import Navigation from '../componsants/navigation/Navigation'
import '../styles/globals.css'
import 'tailwindcss/tailwind.css'

function MyApp({ Component, pageProps }) {

  return (
    <>
      <div className="mtb">
        <Navigation />
        <Component {...pageProps} />
      </div>
    </>
  )
}

export default MyApp

मैं नहीं पता है अगर आप किसी भी विचार है ? मैं के बाद tailwind डॉक्स, लेकिन यह लग रहा है जैसे कि यह पर्याप्त नहीं ahah

Thx

javascript next.js reactjs tailwind-css
2021-11-23 22:50:03
2
0

अगर कुछ वर्गों में काम नहीं कर रहे हैं, और एक अन्य काम = अपने tailwind.css

इसके अलावा, आप उदाहरण Nextjs - Tailwind

अनुलेख अपने कोड का परीक्षण

2021-11-25 11:03:21
0

मैं जवाब मिल गया में एक अन्य पोस्ट और परीक्षण क्योंकि मैं कुछ घटकों पर कर रहे हैं कि conditionnal प्रतिपादन और निर्माण, जबकि अपने अनुप्रयोग tailwind नहीं बनाने कक्षाएं

इस हल करने के लिए आप कर सकते हैं :

  • हटा में शुद्ध tailwind conf (लेकिन यह किया जाना चाहिए अस्थायी)
  • बनाने के लिए घटकों और घोषणा की सभी कक्षाओं में आप के लिए है
2021-11-25 10:51:20

अन्य भाषाओं में

यह पृष्ठ अन्य भाषाओं में है

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

इस श्रेणी में लोकप्रिय

लोकप्रिय सवाल इस श्रेणी में