Skip to content

Commit 360ed8d

Browse files
committed
BREAKING: Remove deprecated addDependencyTo option
1 parent ba76271 commit 360ed8d

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

README.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -172,32 +172,6 @@ It's to optimize output and skip similar files like `normalize.css` for example.
172172
If this behavior is not what you want, just set this option to `false` to
173173
disable it.
174174

175-
#### `addDependencyTo`
176-
177-
Type: `Object`
178-
Default: null
179-
180-
**DEPRECATED.** _If you are using postcss-import v8.2.0 & postcss-loader v1.0.0 or later, this is unnecessary._
181-
182-
An object with `addDependency()` method, taking file path as an argument.
183-
Called whenever a file is imported.
184-
You can use it for hot-reloading in webpack `postcss-loader` like this:
185-
186-
```js
187-
postcss: function(webpack) {
188-
return [
189-
require('postcss-import')({
190-
addDependencyTo: webpack
191-
/* Is equivalent to
192-
onImport: function (files) {
193-
files.forEach(this.addDependency)
194-
}.bind(webpack)
195-
*/
196-
})
197-
]
198-
}
199-
```
200-
201175
#### `addModulesDirectories`
202176

203177
Type: `Array`

index.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,6 @@ function AtImport(options) {
6464
applyMedia(bundle)
6565
applyStyles(bundle, styles)
6666

67-
if (
68-
typeof options.addDependencyTo === "object" &&
69-
typeof options.addDependencyTo.addDependency === "function"
70-
) {
71-
console.warn([
72-
"addDependencyTo is deprecated in favor of",
73-
"result.messages.dependency; postcss-loader >= v1.0.0 will",
74-
"automatically add your imported files to webpack's file watcher.",
75-
"For more information, see",
76-
"https://github.com/postcss/postcss-import\
77-
#dependency-message-support",
78-
].join("\n"))
79-
Object.keys(state.importedFiles)
80-
.forEach(options.addDependencyTo.addDependency)
81-
}
82-
8367
if (typeof options.onImport === "function") {
8468
options.onImport(Object.keys(state.importedFiles))
8569
}

0 commit comments

Comments
 (0)