Coder Social home page Coder Social logo

Comments (4)

 avatar commented on August 23, 2024

Tried the same thing using import postcss from 'postcss', but that didn't work either.

from rollup-plugin-sass.

brendan-jefferis avatar brendan-jefferis commented on August 23, 2024

Following on from that, I changed the name of the parameter style to css which fixed the above error but then got:

postcss(...).process is not a function

I'm new to postcss but I'm pretty sure it has a process function..? Full rollup config below

import sass from "rollup-plugin-sass";
import postcss from "rollup-plugin-postcss";

export default {
    entry: "src/app.js",
    format: "cjs",
    dest: "dist/app.js",
    format: "iife",
    sourceMap: true,
    plugins: [
        sass({
            output: "dist/app.css",
            processor(css) {
                return postcss([ require("autoprefixer") ])
                    .process(css)
                    .then(result => result.css)
                }
            })
    ]
}

from rollup-plugin-sass.

nathancahill avatar nathancahill commented on August 23, 2024

Posted on SO, but posting here for future. Here is my working config:

import sass from 'rollup-plugin-sass'
import autoprefixer from 'autoprefixer'
import postcss from 'postcss'

sass({
    processor: css => postcss([autoprefixer])
        .process(css)
        .then(result => result.css)
})

from rollup-plugin-sass.

 avatar commented on August 23, 2024

@nathancahill got it right. Now the readme just needs updating.

from rollup-plugin-sass.

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.