Skip to content

Commit d32a3e3

Browse files
committed
Add postcss-import
1 parent 9bb1d2c commit d32a3e3

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

package-lock.json

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"eslint": "^6.8.0",
3636
"eslint-config-airbnb-base": "^13.2.0",
3737
"eslint-plugin-import": "^2.20.1",
38-
"postcss": "^7.0.27"
38+
"postcss": "^7.0.27",
39+
"postcss-import": "^12.0.1"
3940
},
4041
"scripts": {
4142
"build": "babel ./src --out-dir ./lib",

src/test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import postcss from 'postcss';
22
import test from 'ava';
33
import plugin from './index';
44

5+
const normalize = cssString => cssString
6+
.replace(/} /g, '}'); /* fix extra space added by `postcss-import` */
7+
58
const run = (t, input, output, opts = {}) => postcss([plugin(opts)])
69
.process(input, {from: undefined})
710
.then((result) => {
8-
t.is(result.css, output);
11+
t.is(normalize(result.css), normalize(output));
912
t.is(result.warnings().length, 0);
1013
});
1114

0 commit comments

Comments
 (0)