feat: add vite-layers

This commit is contained in:
2026-06-07 17:34:31 +07:00
parent aa3148f4e4
commit ecc958c9f0
94 changed files with 4149 additions and 248 deletions
@@ -0,0 +1,7 @@
import { defineLayerConfig } from '../../../src/index.ts'
export default defineLayerConfig({
name: 'brand',
extends: ['../main'],
features: { billing: false }, // brand drops the billing page entirely (DCE)
})
+13
View File
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>vite-layers — brand</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
@@ -0,0 +1 @@
BRAND_LOGO_OVERRIDE
@@ -0,0 +1,9 @@
<script setup lang="ts">
const title = 'BRAND_HEADER_OVERRIDE'
const p2p = __FEATURES__.p2p
</script>
<template>
<header>{{ title }}</header>
<p v-if="p2p">p2p</p>
</template>
@@ -0,0 +1,4 @@
// Brand has no bootstrap logic of its own — it reuses the base layer's entry.
// `@/main.ts` resolves to *this* file first, but the layered resolver's self-skip
// (super() semantics) falls through to the next layer, i.e. main/src/main.ts.
import '@/main.ts'
@@ -0,0 +1,3 @@
{
"extends": "./.vite-layers/tsconfig.json"
}
@@ -0,0 +1,3 @@
import { buildViteConfig } from '../../../src/index.ts'
export default buildViteConfig(import.meta.dirname)