This repository has been archived on 2024-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
postcss-remove-bem-blocks/test/index.js

22 lines
476 B
JavaScript
Raw Normal View History

2022-02-01 19:32:12 +03:00
import {readFile, writeFile} from 'node:fs/promises';
import postcss from 'postcss';
import plugin from './../index.js';
2021-09-30 20:17:23 +03:00
2022-02-01 19:32:12 +03:00
readFile('from.css', {
encoding: 'utf-8',
2021-09-30 20:17:23 +03:00
})
2022-02-01 19:32:12 +03:00
.then((css) => {
return postcss([
plugin({
blocks: ['.block-2'],
}),
]).process(css, {
from: 'from.css',
});
})
.then(({css}) => {
writeFile('to.css', css, {
encoding: 'utf-8',
});
});