@@ -71,6 +71,8 @@ export default defineAddon({
71
71
const ext = typescript ? 'ts' : 'js' ;
72
72
if ( ! kit ) throw new Error ( 'SvelteKit is required' ) ;
73
73
74
+ const paraglideOutDir = 'src/lib/paraglide' ;
75
+
74
76
sv . dependency ( '@inlang/paraglide-sveltekit' , '^0.11.1' ) ;
75
77
76
78
sv . file ( 'project.inlang/settings.json' , ( content ) => {
@@ -104,7 +106,7 @@ export default defineAddon({
104
106
const pluginFunctionCall = functions . call ( vitePluginName , [ ] ) ;
105
107
const pluginConfig = object . create ( {
106
108
project : common . createLiteral ( './project.inlang' ) ,
107
- outdir : common . createLiteral ( './src/lib/paraglide' )
109
+ outdir : common . createLiteral ( `./ ${ paraglideOutDir } ` )
108
110
} ) ;
109
111
functions . argumentByIndex ( pluginFunctionCall , 0 , pluginConfig ) ;
110
112
array . push ( pluginsArray , pluginFunctionCall ) ;
@@ -209,6 +211,15 @@ export default defineAddon({
209
211
return generateCode ( ) ;
210
212
} ) ;
211
213
214
+ sv . file ( '.gitignore' , ( content ) => {
215
+ if ( ! content ) return content ;
216
+
217
+ if ( ! content . includes ( `\n${ paraglideOutDir } ` ) ) {
218
+ content = content . trimEnd ( ) + `\n\n# Paraglide\n${ paraglideOutDir } ` ;
219
+ }
220
+ return content ;
221
+ } ) ;
222
+
212
223
if ( options . demo ) {
213
224
sv . file ( `${ kit . routesDirectory } /demo/+page.svelte` , ( content ) => {
214
225
return addToDemoPage ( content , 'paraglide' ) ;
0 commit comments