Skip to content
New issue

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

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

Already on GitHub? # to your account

config file with function doesn't work if path contains .webpack #1925

Closed
dillonkrug opened this issue Oct 12, 2020 · 1 comment · Fixed by #1926
Closed

config file with function doesn't work if path contains .webpack #1925

dillonkrug opened this issue Oct 12, 2020 · 1 comment · Fixed by #1926
Labels

Comments

@dillonkrug
Copy link

webpack config file where module.exports is a function doesn't work depending on the file path.

If the config file path contains .webpack, the result of calling the config function is ignored.

Steps to reproduce the behavior:

// project/config.webpack.js -- note that filename contains ".webpack"
module.exports = (env) => ({
    entry: 'some-file.js'
    output: {
        path: './dist',
        file: 'some-bundle.js'
    }
});
$/project> webpack --config config.webpack.js

This produces an error saying "./src cannot be resolved" because the actual config is ignored, and webpack falls back to default configuration.

** Cause **

lib/groups/ConfigGroup.js in the finalize function:

    if (configOptions && configPath.includes('.webpack')) {
        // overrides the resolved options
    }

this condition is not specific enough.

@dillonkrug dillonkrug added the Bug label Oct 12, 2020
@alexander-akait
Copy link
Member

Please do not ignore the issue template, in future it will be closed without reply

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants