diff --git a/tools/generate-imports.ts b/tools/generate-imports.ts index 2a8ba9aa52536d44a82bea5699e2b63c5fe793f5..5a91d04a56bb51c8ce478affdaab7dd1d18ff0f5 100644 --- a/tools/generate-imports.ts +++ b/tools/generate-imports.ts @@ -59,11 +59,13 @@ async function generateData(): Promise<void> { const contentMapAssignments: string[] = []; for (const file of files) { - shell.echo(`> ${file}`); + const key = file.replace(/\\/g, '/'); + const rawFileContent = await fs.readFile(file, 'utf8'); - contentMapAssignments.push( - `data.set('${file}', ${JSON.stringify(rawFileContent)});` - ); + const value = JSON.stringify(rawFileContent); + + shell.echo(`> ${key}`); + contentMapAssignments.push(`data.set('${key}', ${value});`); } await updateFile(