-
Notifications
You must be signed in to change notification settings - Fork 213
Properly set mode
and NODE_ENV
for test middleware
#900
Comments
I've been experimenting with setting mode to I've finally got it working, however I can see from the webpack build console output that the hot reloader configs are being added. This doesn't break anything, but is another side-effect of consolidating 9+ different permutations of configuration ( I'd be open to considering Other possible options:
|
This is a blocker for releasing a v9 alpha. @eliperelman do you know when you might be able to take a look at this? |
I'll try and start on this today. |
Previously the only way to override `mode` was by passing `--mode` on the command line. However this is not possible with all tools, since some (such as karma) reject unrecognised arguments. Now: * `mode` is derived from `NODE_ENV` if `--mode` wasn't passed, and !production `NODE_ENV` falls back to mode `development`. * if `--mode` is passed, it takes priority over `NODE_ENV`. * if neither `mode` nor `NODE_ENV is defined, then `NODE_ENV` is set to `production`, however `mode` is left undefined, which causes webpack to output a helpful warning about relying on defaults. * the template test runner configs set a default `NODE_ENV` of `test`. * `@neutrinojs/stylelint` now also correctly sets `failOnError`. Fixes #900. Fixes #971. Closes #955.
In the v8 line of Neutrino we manually default
NODE_ENV
totest
when running the test command. With the removal of the Neutrino CLI, we would no longer have a test command, but we do still have testing middleware via the karma, mocha, and jest presets. We should ensure that we have a reasonable value for theconfig.mode
andNODE_ENV
for test middleware to rely on while trying to get the least number of config permutations.At the outset, I'm wondering if we should have
--mode none
andNODE_ENV=test
, but I think @edmorley had concerns about this particular mode. Also need to ensure that these values can be easily overridden from the host environment.The text was updated successfully, but these errors were encountered: