-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathplugin.ts
34 lines (28 loc) · 1.04 KB
/
plugin.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;(async () => {
try {
await import('vue-i18n')
} catch (e) {
throw new Error(
'@intlify/vue-i18n-loader requires vue-i18n to be present in the dependency tree.'
)
}
})()
import webpack from 'webpack'
declare class IntlifyVuePlugin {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(optoins: Record<string, any>)
apply(compiler: webpack.Compiler): void
}
let Plugin: typeof IntlifyVuePlugin
console.warn(
`[@intlify/vue-i18n-loader] IntlifyVuePlugin is experimental! This plugin is used for Intlify tools. Don't use this plugin to enhancement Component options of your application.`
)
// console.log('[@intlify/vue-i18n-loader] webpack version:', webpack.version)
if (webpack.version && webpack.version[0] > '4') {
// webpack5 and upper
Plugin = require('./pluginWebpack5').default // eslint-disable-line @typescript-eslint/no-var-requires
} else {
// webpack4 and lower
Plugin = require('./pluginWebpack4').default // eslint-disable-line @typescript-eslint/no-var-requires
}
export default Plugin