@energy8platform/game-engine 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/ui/index.ts CHANGED
@@ -1,3 +1,7 @@
1
+ // ─── @pixi/layout setup (must be imported before creating containers) ────
2
+ import '@pixi/layout';
3
+
4
+ // ─── Engine UI Components ─────────────────────────────────
1
5
  export { Button } from './Button';
2
6
  export type { ButtonConfig, ButtonState } from './Button';
3
7
  export { ProgressBar } from './ProgressBar';
@@ -18,3 +22,12 @@ export { Layout } from './Layout';
18
22
  export type { LayoutConfig, LayoutDirection, LayoutAlignment, LayoutAnchor } from './Layout';
19
23
  export { ScrollContainer } from './ScrollContainer';
20
24
  export type { ScrollContainerConfig, ScrollDirection } from './ScrollContainer';
25
+
26
+ // ─── Re-exports from @pixi/ui for direct use ─────────────
27
+ export { FancyButton, ScrollBox, ButtonContainer } from '@pixi/ui';
28
+ export type { ButtonOptions, ScrollBoxOptions, ProgressBarOptions } from '@pixi/ui';
29
+
30
+ // ─── Re-exports from @pixi/layout for direct use ─────────
31
+ export { LayoutContainer } from '@pixi/layout/components';
32
+ export { Layout as PixiLayout } from '@pixi/layout';
33
+ export type { LayoutStyles, LayoutOptions } from '@pixi/layout';
package/src/vite/index.ts CHANGED
@@ -87,7 +87,7 @@ await import('${entrySrc}');
87
87
  * Define a Vite configuration tailored for Energy8 casino games.
88
88
  *
89
89
  * Merges sensible defaults for iGaming projects:
90
- * - Build target: ES2020+
90
+ * - Build target: ESNext (required for yoga-layout WASM top-level await)
91
91
  * - Asset inlining threshold: 8KB
92
92
  * - Source maps for dev, none for prod
93
93
  * - Optional DevBridge auto-injection in dev mode
@@ -122,7 +122,7 @@ export function defineGameConfig(config: GameConfig = {}): UserConfig {
122
122
  ],
123
123
 
124
124
  build: {
125
- target: 'es2020',
125
+ target: 'esnext',
126
126
  assetsInlineLimit: 8192,
127
127
  sourcemap: false,
128
128
  rollupOptions: {
@@ -142,11 +142,31 @@ export function defineGameConfig(config: GameConfig = {}): UserConfig {
142
142
  },
143
143
 
144
144
  resolve: {
145
+ dedupe: [
146
+ 'pixi.js',
147
+ '@pixi/layout',
148
+ '@pixi/layout/components',
149
+ '@pixi/ui',
150
+ 'yoga-layout',
151
+ 'yoga-layout/load',
152
+ ],
145
153
  ...userVite.resolve,
146
154
  },
147
155
 
148
156
  optimizeDeps: {
149
- include: ['pixi.js'],
157
+ include: [
158
+ 'pixi.js',
159
+ '@pixi/layout',
160
+ '@pixi/layout/components',
161
+ '@pixi/ui',
162
+ 'yoga-layout/load',
163
+ ],
164
+ exclude: [
165
+ 'yoga-layout',
166
+ ],
167
+ esbuildOptions: {
168
+ target: 'esnext',
169
+ },
150
170
  ...userVite.optimizeDeps,
151
171
  },
152
172
  };