Skip to content

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

@eamodio

Description

@eamodio

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions