-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8483bba
commit 67b305a
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Chomp.addExtension('[email protected]:npm'); | ||
|
||
Chomp.registerTemplate('svelte', function ({ name, targets, deps, env, templateOptions: { svelteConfig = null, sveltePreprocess = !svelteConfig, sourceMaps = true, autoInstall, ...invalid } }) { | ||
Chomp.registerTemplate('svelte', function ({ name, targets, deps, env, templateOptions: { svelteConfig = null, sveltePreprocess = true, sourceMaps = true, autoInstall, ...invalid } }) { | ||
if (Object.keys(invalid).length) | ||
throw new Error(`Invalid svelte template option "${Object.keys(invalid)[0]}"`); | ||
return [{ | ||
|
@@ -18,8 +18,8 @@ Chomp.registerTemplate('svelte', function ({ name, targets, deps, env, templateO | |
${sveltePreprocess ? ` import sveltePreprocess from 'svelte-preprocess';\n` : ''} | ||
${svelteConfig | ||
? `const { default: svelteConfig } = await import(${svelteConfig === true ? '"./svelte.config.js"' : svelteConfig});` | ||
: `const svelteConfig = {${sveltePreprocess ? ' preprocess: sveltePreprocess() ' : ''}};`} | ||
: `const svelteConfig = {};`} | ||
${sveltePreprocess ? ` svelteConfig.preprocess = svelteConfig.preprocess || sveltePreprocess;\n` : ''} | ||
const filename = process.env.DEP; | ||
const compilerOptions = { | ||
css: false, | ||
|