File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,7 @@ import { preprocess } from 'svelte/compiler'
5
5
import glob from 'fast-glob'
6
6
import { build } from 'vite'
7
7
import { resolveModule } from 'local-pkg'
8
- import sveltePreprocess from 'svelte-preprocess'
9
-
10
- export const sveltePreprocessor = sveltePreprocess ( {
11
- typescript : true ,
12
- // https://github.com/sveltejs/svelte/issues/189#issuecomment-586142198
13
- replace : [
14
- [ / ( > ) [ \s ] * ( [ < { ] ) / g, '$1$2' ] ,
15
- [ / ( { [ / : ] [ a - z ] + } ) [ \s ] * ( [ < { ] ) / g, '$1$2' ] ,
16
- [ / ( { [ # : ] [ a - z ] + .+ ?} ) [ \s ] * ( [ < { ] ) / g, '$1$2' ] ,
17
- [ / ( [ > } ] ) [ \s ] + ( < | { [ / # : ] [ a - z ] [ ^ } ] * } ) / g, '$1$2' ] ,
18
- ] ,
19
- } )
8
+ import { sveltePreprocessor } from './utils.mjs'
20
9
21
10
const pkgName = 'decode-named-character-reference'
22
11
const resolveOptions = {
Original file line number Diff line number Diff line change
1
+ // @ts -check
2
+ import sveltePreprocess from 'svelte-preprocess'
3
+
4
+ export const sveltePreprocessor = sveltePreprocess ( {
5
+ typescript : true ,
6
+ // https://github.com/sveltejs/svelte/issues/189#issuecomment-586142198
7
+ replace : [
8
+ [ / ( > ) [ \s ] * ( [ < { ] ) / g, '$1$2' ] ,
9
+ [ / ( { [ / : ] [ a - z ] + } ) [ \s ] * ( [ < { ] ) / g, '$1$2' ] ,
10
+ [ / ( { [ # : ] [ a - z ] + .+ ?} ) [ \s ] * ( [ < { ] ) / g, '$1$2' ] ,
11
+ [ / ( [ > } ] ) [ \s ] + ( < | { [ / # : ] [ a - z ] [ ^ } ] * } ) / g, '$1$2' ] ,
12
+ ] ,
13
+ } )
Original file line number Diff line number Diff line change 1
1
// @ts -check
2
2
import { defineConfig } from 'tsdv'
3
3
import { svelte } from '@sveltejs/vite-plugin-svelte'
4
- import { sveltePreprocessor } from './build .mjs'
4
+ import { sveltePreprocessor } from './scripts/utils .mjs'
5
5
6
6
// nullish coalescing in es2020
7
7
// TODO: 'decode-named-character-reference'
You can’t perform that action at this time.
0 commit comments