Skip to content
This repository was archived by the owner on Oct 13, 2022. It is now read-only.

Commit f827993

Browse files
authored
Fix TS script for webpack builds (#309)
Co-authored-by: Sean Lailvaux <[email protected]>
1 parent 43c4985 commit f827993

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

scripts/setupTypeScript.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,10 @@ function updateWebpackConfig() {
194194
/entry: config\.serviceworker\.entry\(\)/,
195195
`entry: { 'service-worker': config.serviceworker.entry()['service-worker'].replace(/\\.js$/, '.ts') }`
196196
],
197-
// Add preprocess to the svelte config, this is tricky because there's no easy signifier.
198-
// Instead we look for 'hydratable: true,'
199197
[
200-
/hydratable: true(?!,\n\s*preprocess)/g,
201-
'hydratable: true,\n\t\t\t\t\t\t\tpreprocess: sveltePreprocess({ sourceMap: dev })'
202-
],
198+
/loader: 'svelte-loader',\n\t\t\t\t\t\toptions: {/g,
199+
'loader: \'svelte-loader\',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tpreprocess: sveltePreprocess({ sourceMap: dev }),'
200+
],
203201
// Add TypeScript rules for client and server
204202
[
205203
/module: {\n\s*rules: \[\n\s*(?!{\n\s*test: \/\\\.ts\$\/)/g,

0 commit comments

Comments
 (0)