postcss-config-wapplr

1.0.11 • Public • Published

Postcss-config-wapplr

The default PostCss config for Wapplr structure.

Usage outside the Wapplr

If you want to use this config in a project not built with Wapplr, you can install it with the following steps.

First install,

npm install postcss-config-wapplr --save-dev
const fs = require("fs");
const path = require("path");
const processCssFunction = require("postcss-config-wapplr");

async function processCss(p = {}) {
    await processCssFunction(async function processCss({postcss, plugins, runner}) {

        const from = path.resolve(fromPath);
        const to = path.resolve(toPath);
        const css = fs.readFileSync(from);
        
        //Read more at PostCss Js Api - https://github.com/postcss/postcss#js-api
        const result = await runner.process(css, {from: from, to: to})
        
        if (!fs.existsSync(path.dirname(to))){
            fs.mkdirSync(path.dirname(to), { recursive: true });
        }
        fs.writeFileSync(to, result.css)
        
    })
}

License

MIT

/postcss-config-wapplr/

    Package Sidebar

    Install

    npm i postcss-config-wapplr

    Weekly Downloads

    3

    Version

    1.0.11

    License

    MIT

    Unpacked Size

    3.83 kB

    Total Files

    5

    Last publish

    Collaborators

    • c4rc0