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 committed Jul 9, 2022
2 parents a89c98d + 70d2e77 commit e7ad108
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/cli/src/generators/SVELTE/index.ts
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 e7ad108

Please sign in to comment.