mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
feat(desktop): bundled renderer, modules and instance accounts (#3254)
This commit is contained in:
1 parent
c748c8af4e
commit
7c5fa2180a
1275 files changed
+215074
-81246
No files matched your search
@@ -2,7 +2,30 @@
|
||||
|
||||
import {defineConfig} from 'vitest/config';
|
||||
|
||||
const DESKTOP_MODULE_ASSET_QUERY = /[?&]m=([a-z][a-z0-9_]{0,63})(?:&|$)/;
|
||||
const DESKTOP_MODULE_ASSET_STUB_PREFIX = '\0fluxer-module-asset:';
|
||||
|
||||
function desktopModuleAssetStubPlugin() {
|
||||
return {
|
||||
name: 'fluxer-desktop-module-asset-stub',
|
||||
enforce: 'pre' as const,
|
||||
resolveId(source: string) {
|
||||
return DESKTOP_MODULE_ASSET_QUERY.test(source) ? `${DESKTOP_MODULE_ASSET_STUB_PREFIX}${source}` : null;
|
||||
},
|
||||
load(id: string) {
|
||||
if (!id.startsWith(DESKTOP_MODULE_ASSET_STUB_PREFIX)) {
|
||||
return null;
|
||||
}
|
||||
const source = id.slice(DESKTOP_MODULE_ASSET_STUB_PREFIX.length);
|
||||
const moduleName = DESKTOP_MODULE_ASSET_QUERY.exec(source)?.[1] ?? 'unknown';
|
||||
const name = source.split('?')[0].split('/').pop() ?? 'asset';
|
||||
return `export default ${JSON.stringify(`/assets/${moduleName}/${name}`)};`;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [desktopModuleAssetStubPlugin()],
|
||||
resolve: {tsconfigPaths: true},
|
||||
oxc: {
|
||||
jsx: {runtime: 'automatic', importSource: 'react'},
|
||||
@@ -10,6 +33,13 @@ export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
testTimeout: 30_000,
|
||||
hookTimeout: 30_000,
|
||||
setupFiles: ['./vitest.setup.ts'],
|
||||
env: {
|
||||
PUBLIC_BUILD_VERSION: process.env.PUBLIC_BUILD_VERSION ?? 'dev',
|
||||
PUBLIC_RELEASE_CHANNEL: process.env.PUBLIC_RELEASE_CHANNEL ?? 'development',
|
||||
},
|
||||
include: ['src/**/*.{test,spec}.{ts,tsx}'],
|
||||
exclude: ['node_modules', 'dist', '../.claude/**'],
|
||||
server: {
|
||||
|
||||
Reference in new issue
Block a user