Skip to content

Commit 517958a

Browse files
committed
fixed utils && webpack partial import bug
1 parent ba38dfd commit 517958a

File tree

8 files changed

+25
-14
lines changed

8 files changed

+25
-14
lines changed

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-salad",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "沙拉是一个能够帮助你更加写出更加简洁、优雅的CSS的样式解决方案。",
55
"main": "lib/index.js",
66
"scripts": {
@@ -15,7 +15,6 @@
1515
"chalk": "^1.1.1",
1616
"pixrem": "^3.0.0",
1717
"postcss": "^5.0.4",
18-
"saladcss-bem": "^0.0.1",
1918
"postcss-calc": "^5.0.0",
2019
"postcss-css-reset": "^1.0.2",
2120
"postcss-initial": "^1.3.1",
@@ -25,8 +24,10 @@
2524
"postcss-scss": "^0.1.7",
2625
"postcss-shape": "^0.0.1",
2726
"postcss-short": "^1.4.0",
28-
"postcss-utils": "^1.0.0",
29-
"precss": "^1.4.0"
27+
"postcss-utils": "^1.0.1",
28+
"precss": "^1.4.0",
29+
"saladcss-bem": "^0.0.1",
30+
"saladcss-partial-import": "^1.0.0"
3031
},
3132
"devDependencies": {
3233
"babel-cli": "^6.6.5",
@@ -36,9 +37,6 @@
3637
"babel-preset-react": "^6.5.0",
3738
"babel-preset-stage-1": "^6.5.0",
3839
"eslint": "^1.7.3",
39-
"gulp": "^3.9.1",
40-
"gulp-postcss": "^6.1.0",
41-
"gulp-shell": "^0.5.2",
4240
"tap-spec": "^4.1.0",
4341
"tape": "^4.2.2",
4442
"to-slug-case": "^1.0.0"
@@ -51,4 +49,4 @@
5149
},
5250
"author": "haiping.zeng@ele.me",
5351
"license": "MIT"
54-
}
52+
}

src/features.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export default {
66
* ******************
77
*/
88

9+
// https://npmjs.com/package/saladcss-partial-import
10+
partialImport: (options) => require("saladcss-partial-import")(options),
11+
912
// https://npmjs.com/package/precss
1013
precss: (options) => require("precss")(options),
1114

src/test/features/_import.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
html {
2+
color: #fff;
3+
}

src/test/features/inlineSvg.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
@svg-load nav url(../svgs/nav.svg) {
1+
/*@svg-load nav url(src/test/svgs/nav.svg) {
22
path:nth-child(2){
33
fill:#0ff
44
};
55
}
66
h1 {
77
background: svg-inline(nav)
8-
}
8+
}*/
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
h1 {
2-
background: url("data:image/svg+xml;charset=utf-8,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 50 50\'><path d=\'M10 12h30v4H10z\'/><path d=\'M10 22h30v4H10z\' fill=\'#0ff\'/><path d=\'M10 32h30v4H10z\'/></svg>");
1+
/*@svg-load nav url(src/test/svgs/nav.svg) {
2+
path:nth-child(2){
3+
fill:#0ff
4+
};
35
}
6+
h1 {
7+
background: svg-inline(nav)
8+
}*/

src/test/features/partialimport.css

Whitespace-only changes.

src/test/features/partialimport.expected.css

Whitespace-only changes.

src/test/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ featuresList.forEach(function(name) {
1919
});
2020

2121
options.features[name] = true;
22-
22+
2323
plugin(options).process(input).then((result) => {
2424
let actual = result.css;
2525

2626
utils.write(utils.fixturePath(join("features", name + ".actual")), actual);
2727

2828
tape(name, (t) => {
29-
t.equal(actual, expected, 'feature ' + name + ' test fail!');
29+
t.equal(actual, expected);
3030
t.end();
3131
});
32+
}).catch((e) => {
33+
console.log(e);
3234
});
3335

3436
});

0 commit comments

Comments
 (0)