Skip to content

Commit e5fc41f

Browse files
committed
Add gitattributes & other fixes
1 parent 0789a7a commit e5fc41f

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

docs/adapters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ If you want to use Static Site Generation with the localized router, it is neces
2424
export const onStaticGenerate: StaticGenerateHandler = () => {
2525
return {
2626
params: config.supportedLocales.map(locale => {
27-
return { lang: locale.lang !== config.defaultLocale.lang ? locale.lang : '' };
27+
return { lang: locale.lang !== config.defaultLocale.lang ? locale.lang : '.' };
2828
})
2929
};
3030
};

packages/qwik-speak/tools/inline/plugin.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ const missingValues: string[] = [];
2222
const dynamicKeys: string[] = [];
2323
const dynamicParams: string[] = [];
2424

25-
let baseUrl = false;
26-
2725
/**
2826
* Qwik Speak Inline Vite plugin
2927
*/
@@ -125,10 +123,17 @@ export function qwikSpeakInline(options: QwikSpeakInlineOptions): Plugin {
125123
return code;
126124
}
127125
}
126+
127+
// Check base url
128128
if (target === 'ssr') {
129-
// Base url
130-
if (/(?<!\/\/\s*)base:\s*extractBase/.test(code)) {
131-
baseUrl = true;
129+
if (id.endsWith('entry.ssr.tsx' || id.endsWith('entry.ssr.jsx'))) {
130+
if (!/(?<!\/\/\s*)base:\s*extractBase/.test(code)) {
131+
console.log(
132+
'\n\x1b[31mQwik Speak Inline error\x1b[0m\n%s',
133+
"Missing 'base' option in 'entry.ssr.tsx' file: see https://robisim74.gitbook.io/qwik-speak/tools/inline#usage"
134+
);
135+
process.exit(1)
136+
}
132137
}
133138
}
134139
},
@@ -166,15 +171,6 @@ export function qwikSpeakInline(options: QwikSpeakInlineOptions): Plugin {
166171
);
167172
}
168173
}
169-
if (target === 'ssr') {
170-
if (!baseUrl) {
171-
console.log(
172-
'\n\x1b[31mQwik Speak Inline error\x1b[0m\n%s',
173-
"Missing 'base' option in 'entry.ssr.tsx' file: see https://robisim74.gitbook.io/qwik-speak/tools/inline#usage"
174-
);
175-
process.exit(1)
176-
}
177-
}
178174
}
179175
};
180176

0 commit comments

Comments
 (0)