Skip to content

Commit 74879af

Browse files
committed
Merge pull request #146 from postcss/remove-glob
Remove glob support
2 parents 4fb0c2b + b6ae424 commit 74879af

13 files changed

+13
-83
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ postcssImport({
2828
})
2929
```
3030

31+
- Removed: glob support
32+
([#146](https://github.com/postcss/postcss-import/pull/146))
33+
34+
Globs can be implemented with custom `resolve` option
35+
36+
```js
37+
postcssImport({
38+
resolve: function(id, base) {
39+
return glob.sync(path.join(base, id))
40+
}
41+
})
42+
```
43+
3144
# 7.1.3 - 2015-11-05
3245

3346
- Fixed: ensure node 0.12 compatibility, round 2

README.md

-8
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,6 @@ Default: `null`
125125

126126
Function called after the import process. Take one argument (array of imported files).
127127

128-
#### `glob`
129-
130-
Type: `Boolean`
131-
Default: `false`
132-
133-
Set to `true` if you want @import rules to parse glob patterns.
134-
Files will be searched in base directory and paths specified in `path` option.
135-
136128
#### `resolve`
137129

138130
Type: `Function`

lib/resolve-id.js

-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var fs = require("fs")
22
var path = require("path")
3-
var globby = require("globby")
43
var resolve = require("resolve")
54

65
var moduleDirectories = [
@@ -36,13 +35,6 @@ function resolveModule(id, opts) {
3635
module.exports = function(id, base, options) {
3736
var paths = options.path
3837

39-
if (options.glob) {
40-
paths = [ base ].concat(paths)
41-
return globby(paths.map(function(p) {
42-
return path.resolve(p, id)
43-
}))
44-
}
45-
4638
var resolveOpts = {
4739
basedir: base,
4840
moduleDirectory: moduleDirectories,

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"index.js"
1818
],
1919
"dependencies": {
20-
"globby": "^4.0.0",
2120
"object-assign": "^4.0.1",
2221
"postcss": "^5.0.2",
2322
"postcss-value-parser": "^3.2.3",

test/fixtures/glob-base.css

-1
This file was deleted.

test/fixtures/glob-base.expected.css

-1
This file was deleted.

test/fixtures/glob-missing.css

-2
This file was deleted.

test/fixtures/glob-missing.expected.css

-1
This file was deleted.

test/fixtures/glob-resolve.css

-5
This file was deleted.

test/fixtures/glob-resolve.expected.css

-10
This file was deleted.

test/fixtures/glob.css

-2
This file was deleted.

test/fixtures/glob.expected.css

-3
This file was deleted.

test/glob.js

-41
This file was deleted.

0 commit comments

Comments
 (0)