File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ class FosRouting {
1919 prettyPrint : false ,
2020 domain : [ ] ,
2121 php : 'php' ,
22+ skipCompile : false
2223 } ;
2324
2425 constructor ( options = { } ) {
@@ -29,6 +30,7 @@ class FosRouting {
2930 if ( this . options . target === this . finalTarget ) {
3031 this . options . target += '.tmp' ;
3132 }
33+ this . compile = false === this . options . skipCompile ;
3234 }
3335
3436 // Values don't need to be escaped because node already does that
@@ -81,14 +83,17 @@ class FosRouting {
8183 }
8284 callback ( ) ;
8385 } ;
84- compiler . hooks . beforeRun . tapAsync ( 'RouteDump' , compile ) ;
85- compiler . hooks . watchRun . tapAsync ( 'RouteDump_Watch' , ( comp , callback ) => {
86- if ( ! comp . modifiedFiles || ! comp . modifiedFiles . has ( this . finalTarget ) ) {
87- compile ( comp , callback ) ;
88- } else {
89- callback ( ) ;
90- }
91- } ) ;
86+
87+ if ( this . compile ) {
88+ compiler . hooks . beforeRun . tapAsync ( 'RouteDump' , compile ) ;
89+ compiler . hooks . watchRun . tapAsync ( 'RouteDump_Watch' , ( comp , callback ) => {
90+ if ( ! comp . modifiedFiles || ! comp . modifiedFiles . has ( this . finalTarget ) ) {
91+ compile ( comp , callback ) ;
92+ } else {
93+ callback ( ) ;
94+ }
95+ } ) ;
96+ }
9297
9398 new InjectPlugin ( ( ) => {
9499 return 'import Routing from "fos-router";' +
You can’t perform that action at this time.
0 commit comments