Giter Site home page Giter Site logo

How to add postcss plugins about nuxt.js HOT 6 CLOSED

nuxt avatar nuxt commented on April 27, 2024
How to add postcss plugins

from nuxt.js.

Comments (6)

Atinux avatar Atinux commented on April 27, 2024 2

This option has been added in v0.6.7

Thank you @PatrikLythell for using Nuxt.js 😄

from nuxt.js.

Atinux avatar Atinux commented on April 27, 2024

Can you post your postcss config?

I may add build.postcss option in nuxt.config.js

from nuxt.js.

PatrikLythell avatar PatrikLythell commented on April 27, 2024

Just added postcss-cssnext to vue-loader.config.js inside my nuxt package for giggles. That made the build complain about double autoprefixer though (think it's included in cssnext).

Think build.postcss in nuxt.config.js would be sweet 👍

'use strict'

module.exports = function () {
  let config = {
    postcss: [
      require('postcss-cssnext')(),
      require('autoprefixer')({
        browsers: ['last 3 versions']
      })
    ],
…

from nuxt.js.

qur2 avatar qur2 commented on April 27, 2024

Just for the record, since I spent few hours looking for that, here is the nuxt.config.js that worked for me:

module.exports = {
  build: {
    postcss: [
      require('postcss-nested')(),
      require('postcss-responsive-type')(),
      require('postcss-hexrgba')(),
    ]
  }
}

from nuxt.js.

tiagomatosweb avatar tiagomatosweb commented on April 27, 2024

That's cool, but seems that any scss file included by CSS array in the nuxt.config.js files is not prefixed.

css: [
      { src: '~assets/scss/app.scss', lang: 'scss' },
],

My workaround was import the scss file in the layout vue file, like so

<style lang="scss"> @import "~assets/scss/app.scss"; </style>

Any other better approach?

from nuxt.js.

lock avatar lock commented on April 27, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from nuxt.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.