Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function emittedFilesToInlineOptions(
code: fs.readFileSync(originalPath, 'utf8'),
outputPath,
missingTranslation,
setLocale: emittedFile.name === 'main' || emittedFile.name === 'vendor',
setLocale: emittedFile.name === 'main',
};
originalFiles.push(originalPath);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ async function inlineLocalesDirect(ast: ParseResult, options: InlineOptions) {

let outputSource: import('webpack').sources.Source = content;
if (options.setLocale) {
const setLocaleText = `var $localize=Object.assign(void 0===$localize?{}:$localize,{locale:"${locale}"});\n`;
const setLocaleText = `globalThis.$localize=Object.assign(globalThis.$localize || {},{locale:"${locale}"});\n`;

// If locale data is provided, load it and prepend to file
let localeDataSource;
Expand Down