Skip to content

Commit 1ceb13e

Browse files
committed
BREAKING: Remove onImport option
1 parent 360ed8d commit 1ceb13e

File tree

3 files changed

+0
-33
lines changed

3 files changed

+0
-33
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,6 @@ Default: `undefined`
133133

134134
An array of plugins to be applied on each imported files.
135135

136-
#### `onImport`
137-
138-
Type: `Function`
139-
Default: `null`
140-
141-
Function called after the import process. Take one argument (array of imported
142-
files).
143-
144136
#### `resolve`
145137

146138
Type: `Function`

index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ function AtImport(options) {
6363
applyRaws(bundle)
6464
applyMedia(bundle)
6565
applyStyles(bundle, styles)
66-
67-
if (typeof options.onImport === "function") {
68-
options.onImport(Object.keys(state.importedFiles))
69-
}
7066
})
7167
}
7268
}

test/import-events.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,6 @@ import postcss from "postcss"
99
// plugin
1010
import atImport from ".."
1111

12-
test("should have a callback that returns an object" +
13-
" containing imported files", t => {
14-
return postcss()
15-
.use(atImport({
16-
path: "test/fixtures/imports",
17-
onImport: files => {
18-
t.deepEqual(
19-
files,
20-
[
21-
resolve("test/fixtures/media-import.css"),
22-
resolve("test/fixtures/imports/media-import-level-2.css"),
23-
resolve("test/fixtures/imports/media-import-level-3.css"),
24-
]
25-
)
26-
},
27-
}))
28-
.process(readFileSync("test/fixtures/media-import.css"), {
29-
from: "test/fixtures/media-import.css",
30-
})
31-
})
32-
3312
test("should add dependency message for each import", t => {
3413
return postcss()
3514
.use(atImport({

0 commit comments

Comments
 (0)