Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
Cómo combinar y usar múltiples complementos de Next.js

Me gustaría usar css y scss en la aplicación next.js

Tengo next.config.js en mi proyecto.

Esta configuración es para scss :

 // next.config.js const withSass = require('@zeit/next-sass'); module.exports = withSass({ cssModules: true, cssLoaderOptions: { importLoaders: 1, localIdentName: "[local]___[hash:base64:5]", } })

No sé cómo combinar const withCSS = require('@zeit/next-css'); con mi configuración actual.

Me gustaría usar una configuración personalizada para scss (de mi fragmento de código).

¿Puede alguien ayudarme a configurar a continuación para los módulos css y scss ?

Lo intenté:

 // // next.config.js const withSass = require('@zeit/next-sass'); const withCSS = require('@zeit/next-css'); module.exports = withCSS(withSass({ cssModules: true, cssLoaderOptions: { importLoaders: 1, localIdentName: "[local]___[hash:base64:5]", } }))

No funciona...

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Esto también se puede hacer con bastante facilidad sin la biblioteca next-compose-plugins .

Podría decirse que también es un poco más claro:

 // next.config.js const withSass = require('@zeit/next-sass'); const withCSS = require('@zeit/next-css'); module.exports = (phase, { defaultConfig }) => { const plugins = [ withSass({ /* Plugin config here ... */ }), withCSS({ /* Plugin config here ... */ }), ]; return plugins.reduce((acc, next) => next(acc), { /* global config here ... */ }); };

Descubrí esto mientras me quejaba aquí: Fuente

over 4 years ago · Santiago Trujillo Denunciar

0

Puede usar next-compose-plugins y combinar varios complementos next.js de la siguiente manera:

 // next.config.js const withPlugins = require('next-compose-plugins'); const withSass = require('@zeit/next-sass'); const withCSS = require('@zeit/next-css'); module.exports = withPlugins( [ [withSass, { /* plugin config here ... */ }], [withCSS, { /* plugin config here ... */ }], ], { /* global config here ... */ }, );
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda