Open paulmedynski opened 5 years ago
Opened this in js-preprocess-brunch by mistake. Moved here.
Here's the diff I'm patching index.js
with to solve this problem:
diff -u -r -x package.json node_modules/brunch-preprocessor/lib/index.js new_node_modules/brunch-preprocessor/lib/index.js
--- node_modules/brunch-preprocessor/lib/index.js 2016-09-08 12:37:01.000000000 -0300
+++ new_node_modules/brunch-preprocessor/lib/index.js 2019-04-18 12:54:38.631672148 -0300
@@ -18,6 +18,15 @@
buildEnv: 'debug'
};
}
+ // If our plugin section exists and contains a buildEnv value, use that
+ // instead of the root-level buildEnv.
+ else if (config.plugins !== undefined
+ && config.plugins['js-preprocess'] !== undefined
+ && config.plugins['js-preprocess'].buildEnv !== undefined)
+ {
+ config.buildEnv = config.plugins['js-preprocess'].buildEnv;
+ }
+
while (matched = getNextStatement(data)) {
before = data.substring(0, matched.index);
after = data.substring(matched.endIndex, data.length);
The choice of the config option
buildEnv
causes brunch to emit the following warning when it parses thebrunch-config.js
:12:26:17 - warn: config.overrides.test-module.buildEnv: perhaps you meant buildPath
Moving this config option into a
js-preprocess
plugin section would avoid the problem and better alignjs-preprocess-brunch
's options with the way other plugin options are specified.Right now,
brunch-config.js
looks like this:Moving into a plugin section would look like this: