Skip to content

Commit

Permalink
Merge pull request #18648 from benmccann/patch-4
Browse files Browse the repository at this point in the history
bug: always create main with cjs extension
  • Loading branch information
ndelangen authored and shilman committed Jul 26, 2022
1 parent 3f70ffc commit 9c4f59b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/cli/src/generators/SVELTE/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'");
Expand All @@ -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%%' },
};
Expand All @@ -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,
});
};

Expand Down

0 comments on commit 9c4f59b

Please sign in to comment.