Skip to content

Commit c307b31

Browse files
committed
Made matchOptions matchBase: true by default
1 parent d8a27d0 commit c307b31

File tree

8 files changed

+43
-2
lines changed

8 files changed

+43
-2
lines changed

gulp-cssimport.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ var defaults = {
1515
extensions: null,
1616
filter: null,
1717
matchPattern: null,
18+
matchOptions: {
19+
matchBase: true
20+
},
1821
limit: 5000
1922
};
2023
Object.defineProperty(defaults, "directory", {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gulp-cssimport",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"description": "Parses a CSS file, finds imports, grabs the content of the linked file and replaces the import statement with it.",
55
"main": "gulp-cssimport.js",
66
"scripts": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* a.css */
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* b.css */
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@import '../../../a.css';
2+
@import url('../../b.css');
3+
body {}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/// <reference path="../../typings/node/node.d.ts" />
2+
/// <reference path="../../typings/tape/tape.d.ts" />
3+
var test = require("tape");
4+
var fs = require("fs");
5+
var collect = require("collect-stream");
6+
var plugin = require("../..");
7+
var gulp = require("gulp");
8+
9+
var options = {
10+
matchPattern: '*.css',
11+
};
12+
13+
test("Gulp parent", function(t) {
14+
var stream;
15+
t.plan(1);
16+
var result = fs.readFileSync("result.css", {
17+
encoding: "utf8"
18+
});
19+
stream = gulp.src("design/style/css/main/style.css")
20+
.pipe(plugin(options))
21+
.pipe(gulp.dest("/dev/null"));
22+
collect(stream, function(err, data) {
23+
var file = data[0];
24+
data = file.contents.toString();
25+
// fs.writeFileSync("x.css", data);
26+
t.equal(data, result);
27+
t.end();
28+
});
29+
30+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* a.css */
2+
/* b.css */
3+
body {}

test/gulp-parent/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var collect = require("collect-stream");
66
var plugin = require("../..");
77
var gulp = require("gulp");
88

9-
var options = {};
9+
var options = { matchPattern: '*.css' };
1010

1111
test("Gulp parent", function (t) {
1212
var stream;

0 commit comments

Comments
 (0)