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

Webpack 5: weback.config.js doesn't seem to support a function that returns a config array anymore #1704

Closed
eamodio opened this issue Jul 27, 2020 · 3 comments · Fixed by #1721

Comments

@eamodio
Copy link

eamodio commented Jul 27, 2020

Bug report

What is the current behavior?

See my current webpack.config.js: https://github.com/eamodio/vscode-gitlens/blob/2bfc0360b46933f715379016aed4084ad4e75fae/webpack.config.js

It works fine in Webpack 4, but results in

Compilation Results

 Version: 5.0.0-beta.22
 Built: Sun Jul 26 2020 00:41:05 GMT-0400 (Eastern Daylight Time)
 Compile Time: 36ms
 Output Directory: C:\Users\Eric\code\eamodio\vscode-gitlens\dist
 Hash: dbd0e35abb9cf7150b07

┌────────────┬───────────────────────────────┐
│ Entrypoint │ Bundle                        │
├────────────┼───────────────────────────────┤
│ main       │  Bundle Name       │ main.js  │
│            │  Compared For Emit │ false    │
│            │  Bundle size       │ 0.64 kb  │
│            │                               │
│            │ Modules:                      │
│            │                               │
└────────────┴───────────────────────────────┘

[webpack-cli] Module not found: Error: Can't resolve './index.js' in 'C:\Users\Eric\code\eamodio\vscode-gitlens'

If the current behavior is a bug, please provide the steps to reproduce.

Using this branch: https://github.com/eamodio/vscode-gitlens/commits/feature/webpack5

  1. Clone
  2. Run yarn
  3. Run yarn build

What is the expected behavior?

It should generate multiple bundles.

Other relevant information:
webpack version: 5.0.0-beta.22
Node.js version: v12.16.2
Operating System: Window 10
Additional tools:

@alexander-akait alexander-akait transferred this issue from webpack/webpack Jul 27, 2020
@alexander-akait
Copy link
Member

/cc @webpack/cli-team Can we add tests (or we already have tests)?

@anshumanv
Copy link
Member

I'll take a look

@anshumanv
Copy link
Member

const newOptions = configOptions(this.args.env);

@evilebottnawi first thing I noticed is that we aren't passing the 2nd param argv to the config function, need to support that too, will check

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

Successfully merging a pull request may close this issue.

3 participants