Skip to content

Webpack@5 asset generator property not supported #1729

Closed
@kevinvalk

Description

@kevinvalk

Version

16.0.0-beta.8

Reproduction link

https://github.com/kevinvalk/vue-loader-generator-issue

Steps to reproduce

  • npm install
  • webpack

What is expected?

asset main.js 20 bytes [compared for emit] [minimized] (name: main)
./index.js 21 bytes [built] [code generated]
webpack 5.0.0-rc.0 compiled successfully in 253 ms

What is actually happening?

[webpack-cli] Error: Compiling RuleSet failed: Properties generator are unknown (at clonedRuleSet-1: [object Object])
[webpack-cli] TypeError: Cannot read property 'compilers' of undefined

This is related to the new feature from webpack 5 called Asset Modules (https://webpack.js.org/guides/asset-modules/)

Whenever I add:

...
generator: {
	filename: `images/[name][ext]`,
},
...

to a rule, vue-loader fails with the error mentioned above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions