@@ -182,27 +182,21 @@ function createSvelteConfig(opts) {
182
182
// For some reason create-svelte will turn off preprocessing for jsdoc and no type checking
183
183
// this will break the using of all CSS preprocessing as well, which is undesirable.
184
184
// Here we will just return the typescript default setup
185
- const mdsvexConfig = `import { mdsvex } from 'mdsvex'
186
-
187
- /** @type {import('mdsvex').MdsvexOptions} */
188
- const mdsvexOptions = {
189
- extensions: ['.md'],
190
- }` ;
185
+
191
186
const inspectorConfig = `
192
187
vitePlugin: {
193
188
inspector: true,
194
189
},` ;
195
190
196
191
let str = `import adapter from '@sveltejs/adapter-auto';
197
- import { vitePreprocess } from '@sveltejs/kit/vite';
198
- ${ iit ( opts . mdsvex , mdsvexConfig ) }
192
+ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
199
193
200
194
/** @type {import('@sveltejs/kit').Config} */
201
195
const config = {
202
- extensions: ['.svelte'${ iit ( opts . mdsvex , `, '.md'` ) } ],
196
+ extensions: ['.svelte'],
203
197
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
204
198
// for more information about preprocessors
205
- preprocess: [${ iit ( opts . mdsvex , 'mdsvex(mdsvexOptions),' ) } vitePreprocess()],
199
+ preprocess: [vitePreprocess()],
206
200
${ iit ( opts . inspector , inspectorConfig ) }
207
201
kit: {
208
202
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
@@ -222,21 +216,9 @@ import { sveltekit } from '@sveltejs/kit/vite';
222
216
import { defineConfig } from 'vite';
223
217
224
218
export default defineConfig({
225
- plugins: [sveltekit(), purgeCss(` ;
226
-
227
- if ( opts . codeblocks ) {
228
- contents += `{
229
- safelist: {
230
- // any selectors that begin with "hljs-" will not be purged
231
- greedy: [/^hljs-/],
232
- },
233
- }),
234
- ],
235
- });` ;
236
- } else {
237
- contents += `)]
219
+ plugins: [sveltekit(), purgeCss()]
238
220
});` ;
239
- }
221
+
240
222
writeFileSync ( filename , contents ) ;
241
223
}
242
224
0 commit comments