Skip to content

Commit 167ca0e

Browse files
Basstertobias-93
authored andcommitted
move skipCompile from options to constructir argument, so it won't be passed to the php command as argument.
1 parent 770cb42 commit 167ca0e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Resources/webpack/FosRouting.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@ class FosRouting {
1818
locale: '',
1919
prettyPrint: false,
2020
domain: [],
21-
php: 'php',
22-
skipCompile: false
21+
php: 'php'
2322
};
2423

25-
constructor(options = {}) {
24+
constructor(options = {}, registerCompileHooks = true) {
2625
this.options = Object.assign({target: 'var/cache/fosRoutes.json'}, this.default, options, {format: 'json'});
2726
this.finalTarget = path.resolve(process.cwd(), this.options.target);
2827
this.options.target = path.resolve(process.cwd(), this.options.target.replace(/\.json$/, '.tmp.json'));
2928

3029
if (this.options.target === this.finalTarget) {
3130
this.options.target += '.tmp';
3231
}
33-
this.compile = false === this.options.skipCompile;
32+
this.registerCompileHooks = registerCompileHooks;
3433
}
3534

3635
// Values don't need to be escaped because node already does that
@@ -84,7 +83,7 @@ class FosRouting {
8483
callback();
8584
};
8685

87-
if (this.compile) {
86+
if (this.registerCompileHooks === true) {
8887
compiler.hooks.beforeRun.tapAsync('RouteDump', compile);
8988
compiler.hooks.watchRun.tapAsync('RouteDump_Watch', (comp, callback) => {
9089
if (!comp.modifiedFiles || !comp.modifiedFiles.has(this.finalTarget)) {

0 commit comments

Comments
 (0)