Skip to content

Official approach to pass along template preprocessor options (Pug, e.g.) #832

Closed
@ScorpioX

Description

@ScorpioX

What problem does this feature solve?

With @12.1.0 it was possible (though not officially documented) to set pug doctype like below

{
    test: /\.vue$/,
    loader: 'vue-loader',
    options: {
        template: { doctype: 'html' }
    }
}

Upgrading to @12.2.0, the doctype setting is no longer processed, result in symptoms like below:

div(v-my-directive) ==>

which generates tons of warnings like v, my, directive not defined since Vue tries to interpret "v-my-directive" as JS expression at runtime

I respect the changes in @12.2.0 to "simplify template preprocessor", but I'd like to see an "official" approach to set doctype, or I'll have to settle with @12.1.0

What does the proposed API look like?

The old settings like above or explicit pug rule block alongside vue:

{
  test: /\.pug$/,
  loader: 'pug'
}

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