Fix sprite compiler

This commit is contained in:
2026-08-06 09:32:30 +02:00
parent e353286032
commit a3391e6f1e
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -127,7 +127,7 @@ const changelog = cb => {
.map(x => x.replace(/^\[test\]/, '<span class="badge badge-secondary">test</span>')),
}));
const type = `{ version: string; changes: string[]; }[]`;
const code = `/* eslint:disable */\n\nexport const CHANGELOG: ${type} = ${JSON.stringify(object, null, 2)};\n`;
const code = `/* eslint-disable */\n\nexport const CHANGELOG: ${type} = ${JSON.stringify(object, null, 2)};\n`;
fs.writeFile('src/ts/generated/changelog.ts', code, 'utf8', cb);
};
@@ -180,7 +180,7 @@ const shaders = cb => {
}
const dir = path.join('src', 'ts', 'graphics', 'shaders');
const code = '/* eslint:disable */\n\n' + fs.readdirSync(dir)
const code = '/* eslint-disable */\n\n' + fs.readdirSync(dir)
.map(file => [_.camelCase(file.replace(/\.glsl$/, '')), path.join(dir, file)])
.map(([name, filePath]) => `export const ${name}Shader = \`${getShaderCode(filePath)}\`;`)
.join('\n\n');
+1 -1
View File
@@ -984,7 +984,7 @@ function createSpritesTS(dest: string, config: SpriteTSConfig) {
const { objects, objects2 } = config.result;
let ts = fs.readFileSync(path.join(rootPath, 'src', 'ts', 'tools', 'sprites-template.ts'), 'utf8');
ts = ts.replace(/export \{[\s\S]*?\};\r?\n?/, '');
//ts = ts.replace(/export \{[\s\S]*?\};\r?\n?/, '');
ts = ts.replace('/*SPRITE_SHEET*/', `images/${config.spriteFileName}`);
ts = ts.replace('/*SPRITE_SHEET_PALETTE*/', `images/${config.paletteFileName}`);
ts = ts.replace('/*SPRITE_SHEET_PALETTE_ALPHA*/', `images/${config.paletteAlphaFileName}`);