-
Notifications
You must be signed in to change notification settings - Fork 918
No named VueLoaderPlugin export in TypeScript webpack config #1667
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
Comments
Taking #1542 as inspiration, I tried adding the export directly to import { TemplateCompiler, CompilerOptions, SFCTemplateCompileOptions } from '@vue/compiler-sfc';
+ import { Plugin } from 'webpack';
+ export class VueLoaderPlugin extends Plugin { }
export interface VueLoaderOptions {
transformAssetUrls?: SFCTemplateCompileOptions['transformAssetUrls'];
compiler?: TemplateCompiler;
compilerOptions?: CompilerOptions;
hotReload?: boolean;
exposeFilename?: boolean;
appendExtension?: boolean;
} My uneducated guess is that the problem might be in the way Lines 1 to 12 in 356f686
Line 28 in 356f686
Line 249 in 356f686
|
Simplified the issue a bit. The current work-around is to use module augmentation in |
This change fixes the emitted TypeScript type definitions Closes vuejs#1667.
Fixed in beta 2 |
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:
webpack.config.ts
fileimport { VueLoaderPlugin } from 'vue-loader'
Using the provided repro
lines [13-15]
inwebpack.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?
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:
This is only an issue when using a
webpack.config.ts
, the js version works fine.The text was updated successfully, but these errors were encountered: