Skip to content

[feature]About the hard-coded list of excluded loaders chained before vue-loader #696

Closed
@nicholaslee119

Description

@nicholaslee119

the comment in the line37 of lib/loader.js

// When extracting parts from the source vue file, we want to apply the
// loaders chained before vue-loader, but exclude some loaders that simply
// produces side effects such as linting. This is a hard-coded list and
// hopefully eslint-loader is the only one.

I think it is reasonable to make the list configurable.

for example, In my project, I use htmlhint-loader as preloader before vue-loader to import *.vue

webpack.base.config.js in the vue-cli based project

     {
        test: /\.(html|vue)$/,
        loader: 'htmlhint-loader',
        enforce: 'pre',
        include: [resolve('src'), resolve('test')],
        exclude: /node_modules/
      },

and here is a PR.

thanks for your reading

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