Skip to content

[15.0.0-beta.2] vue-loader generates invalid webpack config #1206

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

Closed
loilo opened this issue Mar 23, 2018 · 1 comment
Closed

[15.0.0-beta.2] vue-loader generates invalid webpack config #1206

loilo opened this issue Mar 23, 2018 · 1 comment

Comments

@loilo
Copy link

loilo commented Mar 23, 2018

Version

15.0.0-beta.2

Reproduction link

https://github.com/Loilo/repro-vue-loader-use-loaders

Steps to reproduce

Clone reproduction repo and install npm dependencies:

git clone https://github.com/Loilo/repro-vue-loader-use-loaders.git
cd repro-vue-loader-use-loaders
npm install

Run webpack:

npx webpack

What is expected?

Webpack should compile as expected.

What is actually happening?

Webpack throws a Rule can only have one result source (provided use and loaders) error.


If a loaders option is present inside a rule, vue-loader correctly extracts the its loaders into the use option.

However, it keeps the loaders option, which makes webpack complain about invalid configuration:

Rule can only have one result source (provided use and loaders) in {
  "loaders": [
    "json-loader",
    "yaml-loader"
  ],
  "use": [
    {
      "loader": "json-loader"
    },
    {
      "loader": "yaml-loader"
    },
    {
      "loader": "vue-loader"
    }
  ]
}

The loaders property should probably be removed after attaching the use section.

@yyx990803
Copy link
Member

Closed via #1207

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

No branches or pull requests

2 participants