@@ -5,10 +5,10 @@ function llmsGeneratorPlugin(context, options) {
5
5
name : 'llms-generator-plugin' ,
6
6
7
7
async postBuild ( { outDir, baseUrl } ) {
8
- console . log ( '🚀 Génération des fichiers LLMs ...' ) ;
8
+ console . log ( '🚀 Generating LLM files ...' ) ;
9
9
10
10
try {
11
- // Import dynamique côté serveur avec le bon chemin
11
+ // Dynamic import server-side with the right path
12
12
const DocusaurusLlmsGenerator = require ( path . resolve ( __dirname , '../scripts/generate-llms' ) ) ;
13
13
14
14
const generator = new DocusaurusLlmsGenerator ( {
@@ -20,18 +20,18 @@ function llmsGeneratorPlugin(context, options) {
20
20
} ) ;
21
21
22
22
await generator . generate ( ) ;
23
- console . log ( '✅ Fichiers LLMs générés avec succès dans le build !' ) ;
23
+ console . log ( '✅ Successfully generated LLMs files in build !' ) ;
24
24
} catch ( error ) {
25
- console . error ( '❌ Erreur lors de la génération des fichiers LLMs :' , error ) ;
26
- // Ne pas faire échouer le build pour cette erreur
25
+ console . error ( '❌ Error while trying to generate LLM files :' , error ) ;
26
+ // Don't make the build fail because of this error
27
27
}
28
28
} ,
29
29
30
30
async loadContent ( ) {
31
- // Génère pendant le développement - UNIQUEMENT côté serveur
31
+ // Generate while development - only server-side
32
32
if ( process . env . NODE_ENV === 'development' ) {
33
33
try {
34
- // Import avec chemin absolu pour éviter les problèmes
34
+ // Absolute path import to avoid issues
35
35
const DocusaurusLlmsGenerator = require ( path . resolve ( process . cwd ( ) , 'scripts/generate-llms' ) ) ;
36
36
37
37
const generator = new DocusaurusLlmsGenerator ( {
@@ -43,17 +43,17 @@ function llmsGeneratorPlugin(context, options) {
43
43
} ) ;
44
44
45
45
await generator . generate ( ) ;
46
- console . log ( '✅ Fichiers LLMs générés pour le développement dans /static/' ) ;
46
+ console . log ( '✅ Successfully generated LLMs files for development in /static/' ) ;
47
47
} catch ( error ) {
48
- console . warn ( '⚠️ Génération LLMs en développement échouée :' , error . message ) ;
48
+ console . warn ( '⚠️ Failed generating LLMs files for development :' , error . message ) ;
49
49
}
50
50
}
51
51
52
- return { } ; // loadContent doit retourner quelque chose
52
+ return { } ; // loadContent should return something
53
53
} ,
54
54
55
55
configureWebpack ( config , isServer ) {
56
- // Ajoute les fallbacks pour éviter les erreurs Webpack côté client
56
+ // Add fallbacks to avoid Webpack errors client side
57
57
if ( ! isServer ) {
58
58
return {
59
59
resolve : {
@@ -80,10 +80,9 @@ function llmsGeneratorPlugin(context, options) {
80
80
return { } ;
81
81
}
82
82
83
- // SUPPRIMÉ : contentLoaded() qui créait les routes conflictuelles
84
- // Les fichiers seront servis directement depuis /static/ en dev
85
- // et depuis /build/ en production
83
+ // Files are served directly from /static/ while on dev mode
84
+ // and from /build/ in production
86
85
} ;
87
86
}
88
87
89
- module . exports = llmsGeneratorPlugin ;
88
+ module . exports = llmsGeneratorPlugin ;
0 commit comments