Skip to content

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

Closed

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:

Activity

  1. alexander-akait commented on Jul 27, 2020

    @alexander-akait
    Member

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

  2. anshumanv commented on Jul 27, 2020

    @anshumanv
    Contributor

    I'll take a look

  3. anshumanv commented on Jul 27, 2020

    @anshumanv
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions