Skip to content

No named VueLoaderPlugin export in TypeScript webpack config #1667

Closed
@davelsio

Description

@davelsio

Version

16.0.0-alpha.3

Reproduction link

File of interest:
https://github.com/davelsan/vue-next-starter/blob/master/webpack.config.ts
Full repo:
https://github.com/davelsan/vue-next-starter

Steps to reproduce

Simple version:

  1. Create a webpack.config.ts file
  2. Try to import { VueLoaderPlugin } from 'vue-loader'

Using the provided repro

  1. Comment lines [13-15] in webpack.config.ts

What is expected?

There should be a named export or a type definition for the default export that allows creating a new VueLoaderPlugin() object.

What is actually happening?

webpack.config.ts:8:10 - error TS2305: Module '"./node_modules/vue-loader/dist"' has no exported member 'VueLoaderPlugin'.

Additional Comments

The repro repository is a working Vue application built without the CLI toolchain. To work around the errors listed above, I augmented the 'vue-loader' plugin as described in the TypeScript documentation:

declare module 'vue-loader' {
  export class VueLoaderPlugin extends Plugin { }
}

This is only an issue when using a webpack.config.ts, the js version works fine.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions