Skip to content
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

[resolver-webpack] Compat with multiple configs #181

Closed
pitaj opened this issue Feb 18, 2016 · 6 comments
Closed

[resolver-webpack] Compat with multiple configs #181

pitaj opened this issue Feb 18, 2016 · 6 comments
Labels

Comments

@pitaj
Copy link

pitaj commented Feb 18, 2016

webpack.config.js can be an array of webpack config objects like so:

module.exports = [
  {
    name: 'configurator',
  },
  {
    name: 'scene',
  }
];

Currently, I have to append this to my config file:

module.exports.resolve = {
  extensions: [
    '',
    '.jsx',
    '.js',
  ],
};

... which shouldn't be necessary. Please add support for multiple webpack configs.

@benmosher
Copy link
Member

Makes sense. Will look into it.

FWIW, if the groups of files covered by each config are fairly disjoint--though I suspect they aren't--you could use nested .eslintrcs and set one config for one set and another for another.

@benmosher
Copy link
Member

Scratch that suggestion. Just realized you meant multiple configs in a single file.

@mk0x9
Copy link

mk0x9 commented Apr 17, 2016

Specify list of extensions in .eslintrc?

@benmosher
Copy link
Member

Actually, might be simpler if you create a webpack.base.js with extensions, resolve, etc. and reference it from the multi-config.

You may then specify that base config as the webpack config for linting.

Otherwise, it may be difficult to determine which of the multiple configs is applicable to the file being linted.

Happy to take a PR if someone has a thought on how to do this without making potentially faulty assumptions.

@GreenGremlin
Copy link
Contributor

GreenGremlin commented May 12, 2016

Here's a PR: #335

It picks the first config that contains a resolve section, which seems appropriate.

@TheSeally
Copy link

@benmosher but if I have aliases in both configs what I should do? Is it possible to merge resolve sections from all configs?
I can try to make PR with config aliases merge if there are no problem conceptually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants