Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Environment-specific configs silently not working after #852 #906

Closed
edmorley opened this issue May 24, 2018 · 5 comments
Closed

Environment-specific configs silently not working after #852 #906

edmorley opened this issue May 24, 2018 · 5 comments
Assignees
Milestone

Comments

@edmorley
Copy link
Member

edmorley commented May 24, 2018

With Neutrino 8 it was possible to define environment specific configs, like so:

module.exports = {
  use: [
    '@neutrinojs/web',
  ],
  env: {
    FOO: {
      bar: {
        use: ['some_other_preset'],
      },
    },
  },
};

...and then 'some_other_preset' would be activated when doing either:

  1. FOO=bar neutrino <command>
  2. neutrino <command> --options.env.FOO bar

After #852, option (2) no longer exists (which is unavoidable), however (1) no longer causes the preset to be loaded - meaning this feature can no longer be used.

@eliperelman
Copy link
Member

eliperelman commented May 24, 2018

This was intended, should we label this docs for migration?

@edmorley
Copy link
Member Author

Even (1)?

@edmorley
Copy link
Member Author

edmorley commented May 24, 2018

Presumably the recommended way now would be to do:

module.exports = {
  use: [
    '@neutrinojs/web',
    (neutrino) => {
      if (process.env.FOO === 'bar') {
        neutrino.use('some_other_preset');
      }
    },
  ],
};

...or alternatively:

module.exports = {
  use: [
    '@neutrinojs/web',
    process.env.FOO === 'bar' ? 'some_other_preset' : false,
  ],
};

@eliperelman eliperelman added this to the v9 milestone May 29, 2018
@edmorley
Copy link
Member Author

If removal of this feature is intentional, I think we should add a check for env and fail loudly if it's passed, to ensure behaviour doesn't silently change.

@eliperelman
Copy link
Member

eliperelman commented Aug 21, 2018

Agreed, and yes, I believe it was intentional on both points.

@edmorley edmorley changed the title Environment-specific configs not working after #852 Environment-specific configs silently not working after #852 Aug 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants