mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 20:15:06 +08:00
18 lines
427 B
JavaScript
18 lines
427 B
JavaScript
|
|
const { testWebpack5 } = require('./codegen/utils')
|
||
|
|
const NS = 'vue-loader'
|
||
|
|
class VueLoaderPlugin {
|
||
|
|
apply(compiler) {
|
||
|
|
let Ctor = null
|
||
|
|
if (testWebpack5(compiler)) {
|
||
|
|
// webpack5 and upper
|
||
|
|
Ctor = require('./plugin-webpack5')
|
||
|
|
} else {
|
||
|
|
// webpack4 and lower
|
||
|
|
Ctor = require('./plugin-webpack4')
|
||
|
|
}
|
||
|
|
new Ctor().apply(compiler)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
VueLoaderPlugin.NS = NS
|
||
|
|
module.exports = VueLoaderPlugin
|