build: publish frontend source maps

This commit is contained in:
2026-08-15 16:31:18 +00:00
parent 8399a120ed
commit e3234df34d
8 changed files with 54 additions and 0 deletions
+16
View File
@@ -1,5 +1,7 @@
import assert from 'node:assert/strict';
import path from 'node:path';
import { describe, it } from 'node:test';
import { loadConfigFromFile } from 'vite';
import { mergeViteEnv } from '../src/config/viteEnv.ts';
void describe('game frontend Vite config', () => {
@@ -12,4 +14,18 @@ void describe('game frontend Vite config', () => {
assert.equal(env.VITE_APP_BASE_PATH, '/hwe');
assert.equal(env.VITE_GAME_API_URL, '/hwe/api/trpc');
});
void it('keeps production source maps enabled', async () => {
const configPath = path.resolve(import.meta.dirname, '../vite.config.ts');
const loaded = await loadConfigFromFile(
{ command: 'build', mode: 'production' },
configPath,
path.dirname(configPath),
undefined,
undefined,
'runner'
);
assert.equal(loaded?.config.build?.sourcemap, true);
});
});
+3
View File
@@ -30,6 +30,9 @@ export default defineConfig(({ mode }) => {
return {
base: normalizeBasePath(env.VITE_APP_BASE_PATH),
plugins: [vue(), tailwindcss()],
build: {
sourcemap: true,
},
resolve: {
alias: {
'@': path.resolve(import.meta.dirname, './src'),
+1
View File
@@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"test": "node --test test/**/*.test.mjs",
"test:e2e:operations": "playwright test --config e2e/playwright.config.mjs",
"test:e2e:hwe-lifecycle": "playwright test --config e2e/hwe-lifecycle.playwright.config.mjs",
"test:e2e:general-icons": "playwright test --config e2e/general-icon-lifecycle.playwright.config.mjs",
@@ -0,0 +1,20 @@
import assert from 'node:assert/strict';
import path from 'node:path';
import { describe, it } from 'node:test';
import { loadConfigFromFile } from 'vite';
void describe('gateway frontend Vite config', () => {
void it('keeps production source maps enabled', async () => {
const configPath = path.resolve(import.meta.dirname, '../vite.config.ts');
const loaded = await loadConfigFromFile(
{ command: 'build', mode: 'production' },
configPath,
path.dirname(configPath),
undefined,
undefined,
'runner'
);
assert.equal(loaded?.config.build?.sourcemap, true);
});
});
+3
View File
@@ -29,6 +29,9 @@ export default defineConfig(({ mode }) => {
return {
base: normalizeBasePath(env.VITE_APP_BASE_PATH),
plugins: [vue(), tailwindcss()],
build: {
sourcemap: true,
},
resolve: {
alias: {
'@': path.resolve(import.meta.dirname, './src'),