Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: always create main with cjs extension #18648

Merged
merged 2 commits into from Jul 9, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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