Skip to content

[webpack-plugin] fix(#465): Exclude php from command arguments #490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Resources/webpack/FosRouting.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FosRouting {
domain: [],
php: 'php'
};
nonArgumentOptions = ['php'];

constructor(options = {}, registerCompileHooks = true) {
this.options = Object.assign({target: 'var/cache/fosRoutes.json'}, this.default, options, {format: 'json'});
Expand Down Expand Up @@ -54,6 +55,10 @@ class FosRouting {
}
const compile = async (comp, callback) => {
const args = Object.keys(this.options).reduce((pass, key) => {
if (this.nonArgumentOptions.includes(key)) {
return pass;
}

const val = this.options[key];
if (val !== this.default[key]) {
if (Array.isArray(val)) {
Expand Down Expand Up @@ -82,7 +87,7 @@ class FosRouting {
}
callback();
};

if (this.registerCompileHooks === true) {
compiler.hooks.beforeRun.tapAsync('RouteDump', compile);
compiler.hooks.watchRun.tapAsync('RouteDump_Watch', (comp, callback) => {
Expand Down
Loading