- ClassParams
- DepCtorParams
- DependencyOptions
- DependencyParams
- ExportType
- I18nDependencyClass
- I18nModuleClass
- LoaderContext
- SourceType
- SourceTypeData
- Tail
- Taps
- addQueryParams
- entrypointName
- extractVueI18nData
- getDebugLogger
- isVueI18nLoaderResource
- resolveResource
- splitArray
Ƭ ClassParams: object
Defined in src/types/index.ts:37
-
constructorOptions: ConstructorOptions
-
dependencyClass: I18nDependencyClass
-
moduleClass: I18nModuleClass
Ƭ DepCtorParams: ConstructorParameters‹typeof Dependency›
Defined in src/types/index.ts:11
Ƭ DependencyOptions: DependencyOptions & object
Defined in src/types/index.ts:7
Ƭ DependencyParams: [DependencyOptions, DepCtorParams[1], DepCtorParams[2]]
Defined in src/types/index.ts:12
Ƭ ExportType: "json" | "yaml"
Defined in src/types/index.ts:30
Ƭ I18nDependencyClass: types.DependencyClass‹I18nDependency, DependencyParams›
Defined in src/types/index.ts:18
Ƭ I18nModuleClass: types.ModuleClass‹I18nModule, I18nDependency› & typeof Module
Defined in src/types/index.ts:27
Ƭ LoaderContext: PitchContext["loaderContext"]
Defined in src/lib/resolve-resource.ts:13
Ƭ SourceType: "json" | "yaml"
Defined in src/lib/resolve-resource.ts:6
Ƭ SourceTypeData: object
Defined in src/lib/resolve-resource.ts:7
-
lang: SourceType | null
-
locale: string | null
-
vue: boolean | null
Ƭ Tail: function extends function ? R : never
Defined in src/types/index.ts:52
Ƭ Taps: types.hook.Taps‹MiniI18nExtractPlugin›
Defined in src/types/index.ts:47
• MiniI18nExtractPlugin: object = miniExtractPluginFactory({ type, dependencyClass: Dependency, moduleClass: Module as I18nModuleClass, pluginOptionsSchema, hooks: [ { name: 'initialize' as 'initialize', type: 'tap' as 'tap', hooks: [hooks.initialize!], }, { name: 'source' as 'source', type: 'tap' as 'tap', hooks: [hooks.source!], }, { name: 'dependency' as 'dependency', type: 'tap' as 'tap', hooks: [hooks.dependency!], }, { name: 'extracted' as 'extracted', type: 'tap' as 'tap', hooks: [hooks.extracted!], }, { name: 'beforeRenderMain' as 'beforeRenderMain', type: 'tap' as 'tap', hooks: [hooks.beforeRenderMain!], }, { name: 'merge' as 'merge', type: 'tap' as 'tap', hooks: [hooks.merge!], }, ], })
Defined in src/index.ts:17
- new __type(
options?
: T["options"]): T
• debug: log = getDebugLogger()
Defined in src/lib/debug.ts:16
• pluginOptionsSchema: object & object = merge( {}, schema.pluginOptions, customOptionsSchema, )
Defined in src/schemas/plugin-options.ts:19
• type: "i18n" = "i18n"
Defined in src/config.ts:1
• typeReadable: "I18n" = "I18n"
Defined in src/config.ts:2
▸ addQueryParams(url
: string, params
: object): string
Defined in src/lib/add-query-params.ts:6
Parameters:
Name | Type | Default |
---|---|---|
url |
string | - |
params |
object | {} |
Returns: string
▸ entrypointName(chunk
: Chunk): string | undefined
Defined in src/lib/entrypoint-name.ts:6
Find Chunk's entrypoint name
Parameters:
Name | Type |
---|---|
chunk |
Chunk |
Returns: string | undefined
▸ extractVueI18nData(exportsData
: any): any
Defined in src/lib/extract-vue-i18n-data.ts:4
Extract data from source that came from VueI18n loader
Parameters:
Name | Type |
---|---|
exportsData |
any |
Returns: any
▸ getDebugLogger(): log
Defined in src/lib/debug.ts:4
Returns: log
▸ isVueI18nLoaderResource(query
: object): boolean
Defined in src/lib/resolve-resource.ts:15
Parameters:
Name | Type |
---|---|
query |
object |
Returns: boolean
▸ resolveResource(loaderCtx
: LoaderContext): object
Defined in src/lib/resolve-resource.ts:19
Parameters:
Name | Type |
---|---|
loaderCtx |
LoaderContext |
Returns: object
-
lang: SourceType | null
-
locale: string | null
-
vue: boolean | null
▸ splitArray<T, C>(arr
: T[], categorizer
: function): T[][]
Defined in src/lib/split-array.ts:5
Split an array into an array of arrays based on the return value of categorizer. Items with matching return values are grouped together.
Type parameters:
▪ T
▪ C
Parameters:
▪ arr: T[]
▪ categorizer: function
▸ (a
: T, ...args
: any[]): C
Parameters:
Name | Type |
---|---|
a |
T |
...args |
any[] |
Returns: T[][]
Defined in src/schemas/plugin-options.ts:4
▪ errorMessages: object
Defined in src/schemas/plugin-options.ts:14
- exportType: string = "must be either 'json' or 'yaml'"
▪ properties: object
Defined in src/schemas/plugin-options.ts:5
-
exportType: object
-
oneOf: object[] = [{ enum: ['yaml', 'json'] }]
-
type: string = "string"
-
-
splitLocales: object
- type: string = "boolean"
Defined in src/hooks.ts:15
▸ beforeRenderMain(context
: RenderContext‹MiniI18nExtractPlugin‹››, modules
: I18nModule‹› & Module‹object, Dependency‹object, DependencyOptions, any››[]): I18nModule‹› & Module‹object, Dependency‹object, DependencyOptions, any››[][]
Defined in src/hooks.ts:142
If splitLocales
is enabled, split the modules that should be rendered
for a given entrypoint into groups by locale, so separate files are
emitted for individual locales.
Parameters:
Name | Type |
---|---|
context |
RenderContext‹MiniI18nExtractPlugin‹›› |
modules |
I18nModule‹› & Module‹object, Dependency‹object, DependencyOptions, any››[] |
Returns: I18nModule‹› & Module‹object, Dependency‹object, DependencyOptions, any››[][]
▸ dependency(context
: PitchCompilationContext‹MiniI18nExtractPlugin‹››, dependencyContext
: LoaderModuleContext): object[]
Defined in src/hooks.ts:77
Split i18n data of each file into separate blocks by locales so they could be possibly optimized/cached
Parameters:
Name | Type |
---|---|
context |
PitchCompilationContext‹MiniI18nExtractPlugin‹›› |
dependencyContext |
LoaderModuleContext |
Returns: object[]
▸ extracted(context
: PitchCompilationContext‹MiniI18nExtractPlugin‹››, remainingSource
: string): string
Defined in src/hooks.ts:131
Return empty JSON object, so the loader works with JSON Webpack module rules
Parameters:
Name | Type |
---|---|
context |
PitchCompilationContext‹MiniI18nExtractPlugin‹›› |
remainingSource |
string |
Returns: string
▸ initialize(instance
: MiniI18nExtractPlugin‹›, options
: ConstructorOptions‹›): void
Defined in src/hooks.ts:19
Set defaults
Parameters:
Name | Type |
---|---|
instance |
MiniI18nExtractPlugin‹› |
options |
ConstructorOptions‹› |
Returns: void
▸ merge(ctx
: RenderContext‹MiniI18nExtractPlugin‹››, modules
: I18nModule‹› & Module‹object, Dependency‹object, DependencyOptions, any››[]): ConcatSource‹›
Defined in src/hooks.ts:154
Override the merging process to join the i18n data as JSONs
Parameters:
Name | Type |
---|---|
ctx |
RenderContext‹MiniI18nExtractPlugin‹›› |
modules |
I18nModule‹› & Module‹object, Dependency‹object, DependencyOptions, any››[] |
Returns: ConcatSource‹›
▸ source(context
: PitchCompilationContext‹MiniI18nExtractPlugin‹››): any
Defined in src/hooks.ts:33
Modify the source from intlify/vue-i18n-loader and pass the module ID along
Parameters:
Name | Type |
---|---|
context |
PitchCompilationContext‹MiniI18nExtractPlugin‹›› |
Returns: any