-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (33 loc) · 738 Bytes
/
Copy pathindex.js
File metadata and controls
37 lines (33 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import fs from 'fs';
import path from 'path';
import postcss from 'postcss';
import reporter from 'postcss-reporter';
import plugin from '../';
const read = name =>
fs.readFileSync(path.join(__dirname, '..', 'test', 'fixture', name), 'utf8');
var opts = {
basePath: 'test/fixture',
maps: [
{
config: {
foo: 'foo value',
bar: 'bar value',
},
},
'dummy.yml',
'fonts.yml',
'breakpoints.yml',
'assets.yml',
],
};
['object', 'value', 'block', 'atrule'].forEach(test => {
const input = read(`${test}/input.css`);
postcss()
.use(plugin(opts))
.use(reporter)
.process(input)
.then(result => {
console.log(result.css);
})
.catch(console.error);
});