Skip to content

Commit c019fd4

Browse files
committed
fix: duplicated builds
1 parent 1e99e25 commit c019fd4

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

packages/bytemd/build.mjs renamed to packages/bytemd/scripts/build.mjs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,7 @@ import { preprocess } from 'svelte/compiler'
55
import glob from 'fast-glob'
66
import { build } from 'vite'
77
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'
209

2110
const pkgName = 'decode-named-character-reference'
2211
const resolveOptions = {

packages/bytemd/scripts/utils.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
})

packages/bytemd/tsdv.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22
import { defineConfig } from 'tsdv'
33
import { svelte } from '@sveltejs/vite-plugin-svelte'
4-
import { sveltePreprocessor } from './build.mjs'
4+
import { sveltePreprocessor } from './scripts/utils.mjs'
55

66
// nullish coalescing in es2020
77
// TODO: 'decode-named-character-reference'

0 commit comments

Comments
 (0)