From ad37afcfd925947ce9be1ca9744782210c8c67a5 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Wed, 6 Jul 2022 15:18:33 -0700 Subject: [PATCH] Always create main with cjs extension --- lib/cli/src/generators/SVELTE/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/cli/src/generators/SVELTE/index.ts b/lib/cli/src/generators/SVELTE/index.ts index a5b5c9c0879e..d9507ce8d141 100644 --- a/lib/cli/src/generators/SVELTE/index.ts +++ b/lib/cli/src/generators/SVELTE/index.ts @@ -5,7 +5,6 @@ import { baseGenerator, Generator } from '../baseGenerator'; const generator: Generator = async (packageManager, npmOptions, options) => { let extraMain; - let commonJs = false; // svelte.config.js ? if (fse.existsSync('./svelte.config.js')) { logger.info("Configuring preprocessor from 'svelte.config.js'"); @@ -16,8 +15,6 @@ const generator: Generator = async (packageManager, npmOptions, options) => { } else if (fse.existsSync('./svelte.config.cjs')) { logger.info("Configuring preprocessor from 'svelte.config.cjs'"); - commonJs = true; - extraMain = { svelteOptions: { preprocess: '%%require("../svelte.config.cjs").preprocess%%' }, }; @@ -37,7 +34,7 @@ const generator: Generator = async (packageManager, npmOptions, options) => { extraPackages: ['svelte', 'svelte-loader'], extensions: ['js', 'jsx', 'ts', 'tsx', 'svelte'], extraMain, - commonJs, + commonJs: true, }); };