File tree Expand file tree Collapse file tree 2 files changed +8
-28
lines changed
Expand file tree Collapse file tree 2 files changed +8
-28
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,14 @@ function AtImport(options) {
6363 typeof options . addDependencyTo === "object" &&
6464 typeof options . addDependencyTo . addDependency === "function"
6565 ) {
66+ console . warn ( [
67+ "addDependencyTo is deprecated in favor of" ,
68+ "result.messages.dependency; postcss-loader >= v1.0.0 will" ,
69+ "automatically add your imported files to webpack's file watcher." ,
70+ "For more information, see" ,
71+ "https://github.com/postcss/postcss-import\
72+ #dependency-message-support" ,
73+ ] . join ( "\n" ) )
6674 Object . keys ( state . importedFiles )
6775 . forEach ( options . addDependencyTo . addDependency )
6876 }
Original file line number Diff line number Diff line change @@ -25,34 +25,6 @@ test("should have a callback that returns an object" +
2525 } )
2626} )
2727
28- test ( "should have a callback shortcut for webpack" , t => {
29- var files = [ ]
30- var webpackMock = {
31- addDependency : file => {
32- files . push ( file )
33- } ,
34- }
35-
36- return postcss ( )
37- . use ( atImport ( {
38- path : "fixtures/imports" ,
39- addDependencyTo : webpackMock ,
40- } ) )
41- . process ( readFileSync ( "fixtures/media-import.css" ) , {
42- from : "fixtures/media-import.css" ,
43- } )
44- . then ( ( ) => {
45- t . deepEqual (
46- files ,
47- [
48- resolve ( "fixtures/media-import.css" ) ,
49- resolve ( "fixtures/imports/media-import-level-2.css" ) ,
50- resolve ( "fixtures/imports/media-import-level-3.css" ) ,
51- ]
52- )
53- } )
54- } )
55-
5628test ( "should add dependency message for each import" , t => {
5729 return postcss ( )
5830 . use ( atImport ( {
You can’t perform that action at this time.
0 commit comments