Skip to content

PostCSS Usage Clarification #1351

@alessio-libardi

Description

@alessio-libardi

Hello everyone, I'm trying to use this amazing project for my personal website and wanted to use PostCSS but couldn't find the resources to get it working.

Some clarification on how to use PostCSS would be really appreciated, I'm trying to use two simple plugins but it's not working as I expected it would be, can someone help me out? 🍣

Following my web-dev-server.config.js, thanks anyone 🙌

import { fromRollup } from '@web/dev-server-rollup';
import rollupPostcss from 'rollup-plugin-postcss';
import postcssPresetEnv from 'postcss-preset-env'
import postcssNano from 'cssnano'

const postcss = fromRollup(rollupPostcss);

export default {
    rootDir: 'src',
    open: true,
    watch: true,
    plugins: [
        postcss({ 
            include: ['src/**/*.css'],
            plugins: [
                postcssPresetEnv({
                    stage: 1,
                }),
                postcssNano({
                    preset: 'default'
                })
            ] 
        })
    ]
};

With this configuration I would expect my css to get prefixed and minified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions