diff --git a/src/interfaces/plugin-options.ts b/src/interfaces/plugin-options.ts index 161f9ec..0c282ee 100644 --- a/src/interfaces/plugin-options.ts +++ b/src/interfaces/plugin-options.ts @@ -10,4 +10,5 @@ export interface PluginOptionsInterface extends OptionsInterface { export interface VitePluginOptionsInterface { langPath?: string additionalLangPaths?: string[] + excludeFrameworkTranslations: boolean } diff --git a/src/vite.ts b/src/vite.ts index 0e5c9eb..b98384e 100644 --- a/src/vite.ts +++ b/src/vite.ts @@ -11,7 +11,8 @@ export default function i18n(options: string | VitePluginOptionsInterface = 'lan const additionalLangPaths = typeof options === 'string' ? [] : options.additionalLangPaths ?? [] - const frameworkLangPath = 'vendor/laravel/framework/src/Illuminate/Translation/lang/'.replace('/', path.sep) + const excludeFrameworkTranslations = typeof options === 'string' ? options === 'lang' : options.excludeFrameworkTranslations ?? true + const frameworkLangPath = excludeFrameworkTranslations ? '' : 'vendor/laravel/framework/src/Illuminate/Translation/lang/'.replace('/', path.sep) let files: ParsedLangFileInterface[] = [] let exitHandlersBound: boolean = false