@rpgjs/vite 5.0.0-alpha.4 → 5.0.0-alpha.41

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.
@@ -0,0 +1,48 @@
1
+ import { Plugin } from 'vite';
2
+ export interface EntryPointPluginOptions {
3
+ /**
4
+ * Entry points configuration for different RPG types
5
+ * @default { rpg: './src/standalone.ts', mmorpg: './src/client.ts' }
6
+ */
7
+ entryPoints?: {
8
+ rpg?: string;
9
+ mmorpg?: string;
10
+ };
11
+ /**
12
+ * RPG type from environment variable
13
+ * @default process.env.RPG_TYPE || 'rpg'
14
+ */
15
+ rpgType?: string;
16
+ }
17
+ /**
18
+ * Plugin Vite qui gère les points d'entrée selon le type de RPG
19
+ *
20
+ * Ce plugin modifie automatiquement le fichier HTML pour insérer la bonne balise script
21
+ * selon la variable d'environnement RPG_TYPE. Il supporte deux types :
22
+ * - 'rpg' : pour le mode standalone
23
+ * - 'mmorpg' : pour le mode multijoueur
24
+ *
25
+ * Le plugin recherche dans le HTML les balises script existantes et les remplace
26
+ * par le bon point d'entrée selon le type configuré.
27
+ *
28
+ * @param options - Configuration du plugin
29
+ * @returns Plugin Vite
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * // vite.config.ts
34
+ * import { entryPointPlugin } from '@rpgjs/vite';
35
+ *
36
+ * export default defineConfig({
37
+ * plugins: [
38
+ * entryPointPlugin({
39
+ * entryPoints: {
40
+ * rpg: './src/standalone.ts',
41
+ * mmorpg: './src/client.ts'
42
+ * }
43
+ * })
44
+ * ]
45
+ * });
46
+ * ```
47
+ */
48
+ export declare function entryPointPlugin(options?: EntryPointPluginOptions): Plugin;
package/dist/index.d.ts CHANGED
@@ -2,3 +2,7 @@ export { tiledMapFolderPlugin, type DataFolderPluginOptions } from './tiled-map-
2
2
  export { rpgjsModuleViteConfig } from './module-config';
3
3
  export { directivePlugin, type DirectivePluginOptions } from './directive-plugin';
4
4
  export { removeImportsPlugin, type RemoveImportsPluginOptions } from './remove-imports-plugin';
5
+ export { replaceConfigImport } from './replace-config-import';
6
+ export { rpgjs } from './rpgjs-plugin';
7
+ export { serverPlugin } from './server-plugin';
8
+ export { entryPointPlugin, type EntryPointPluginOptions } from './entry-point-plugin';