@@ -2,7 +2,9 @@ import type { LayerName } from '@windicss/plugin-utils'
22import { createUtils } from '@windicss/plugin-utils'
33import { join , resolve } from 'pathe'
44import VirtualModulesPlugin from 'webpack-virtual-modules'
5- import type { Compiler , WindiCSSWebpackPluginOptions } from './types'
5+ import type { Compiler } from 'webpack'
6+ import { Plugin } from 'webpack'
7+ import type { WindiCSSWebpackPluginOptions } from './types'
68import { DEVTOOLS_MODULE_ID , DEVTOOLS_VIRTUAL_MODULE , DEVTOOLS_VIRTUAL_MODULE_ID , MODULE_ID , MODULE_ID_VIRTUAL_MODULES , MODULE_ID_VIRTUAL_TEST , NAME } from './core/constants'
79import debug from './core/debug'
810import { def } from './core/utils'
@@ -17,10 +19,11 @@ const transformTemplateLoader = resolve(loadersPath, 'windicss-template.cjs')
1719const virtualModuleLoader = resolve ( loadersPath , 'virtual-module.cjs' )
1820const devtoolsLoader = resolve ( loadersPath , 'dev-tools.cjs' )
1921
20- class WindiCSSWebpackPlugin {
22+ class WindiCSSWebpackPlugin extends Plugin {
2123 options
2224
2325 constructor ( options : Partial < WindiCSSWebpackPluginOptions > = { } ) {
26+ super ( )
2427 // @todo validate options
2528 this . options = {
2629 // default options
@@ -32,7 +35,7 @@ class WindiCSSWebpackPlugin {
3235 } as WindiCSSWebpackPluginOptions
3336 }
3437
35- apply ( compiler : Compiler ) : void {
38+ apply ( compiler : Compiler ) {
3639 // resolve the root working directory
3740 let root = compiler . context
3841 if ( this . options . root )
0 commit comments