-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hello, I think an example of how to use the plugin with es6 modules could be helpful. Here's an proposal:
Use (ES6)
import postcss from 'postcss';
import spiffing from 'postcss-spiffing';
import * as fs from 'fs';
const css = fs.readFileSync('random.css');
console.log(postcss(spiffing()).process(css).css);Maybe a section about loading ES6 modules in node with ESM (https://github.com/standard-things/esm) might be helpful, too:
Execute in Node >= 13
// Execute directly
node main.js
// Execute via npm scripts
// package.json
{
...
"type": "module",
"scripts": {
"convert": "node main.js"
}
....
}
// Command line
npm run convert
yarn convertMetadata
Metadata
Assignees
Labels
No labels