Skip to content

The presence of the vue-loader plugin breaks rules written with resource #1254

Closed
@Jessidhia

Description

@Jessidhia

Version

15.0.0

Reproduction link

https://github.com/Kovensky/vue-loader-bug

Steps to reproduce

Having any rule, in your webpack config, that specifies a resource function, causes the config to fail validation, because the vue-loader plugin will unconditionally inject a test function in it. test, include and exclude are mutually incompatible with resource (webpack works internally by generating a resource function that validates the test/include/exclude).

What is expected?

A rule with resource should be passed through, preferably unmodified.

What is actually happening?

Error: Rule can only have one resource source (provided resource and test + include + exclude)

Why does CodeSandbox not let me edit the webpack config for a vue-loader bug report? That makes it not very useful, at least for vue-loader.

As for background, I'm trying to write a config that works on a mixed js-ts project; and unless some measures are taken to not pass in-.vue js to ts-loader, they will be parsed and compiled as if they are typescript. A workaround is to just not pass anything js to ts-loader, but that then removes type checking from // @ts-check files.


EDIT: vue-issues does not escape + so any + you write in the issue template gets converted into a space 🤷‍♀️

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