-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: finish inline match resource chore: cleanup chore: cleanup feat: add experimental css support feat: dispatch plugin dynammically feat: support option `experimentalInlineMatchResource` chore: enable test on CI chore: disable sourceMap generation ] docs: add option doc docs: correct version fix: fix lang matching feat: use a relatively better version test fix: fix incorrect match with `experiments.css` enabled fix: more accurate when matching styles feat: optimize for `Rule.loader` fix: import
- Loading branch information
Showing
15 changed files
with
337 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import webpack from 'webpack' | ||
import type { Compiler } from 'webpack' | ||
import { testWebpack5 } from './util' | ||
|
||
declare class VueLoaderPlugin { | ||
static NS: string | ||
apply(compiler: Compiler): void | ||
} | ||
|
||
let Plugin: typeof VueLoaderPlugin | ||
const NS = 'vue-loader' | ||
|
||
if (webpack.version && webpack.version[0] > '4') { | ||
// webpack5 and upper | ||
Plugin = require('./pluginWebpack5').default | ||
} else { | ||
// webpack4 and lower | ||
Plugin = require('./pluginWebpack4').default | ||
class Plugin { | ||
static NS = NS | ||
apply(compiler: Compiler) { | ||
let Ctor: typeof VueLoaderPlugin | ||
if (testWebpack5(compiler)) { | ||
// webpack5 and upper | ||
Ctor = require('./pluginWebpack5').default | ||
} else { | ||
// webpack4 and lower | ||
Ctor = require('./pluginWebpack4').default | ||
} | ||
new Ctor().apply(compiler) | ||
} | ||
} | ||
|
||
export default Plugin |
Oops, something went wrong.