Skip to content

Commit

Permalink
fix: double default
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiao committed Nov 19, 2024
1 parent 8b79132 commit 1c26a12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'father';

export default defineConfig({
cjs: {
transformer: 'babel',
input: 'src',
output: 'dist',
},
Expand Down
7 changes: 2 additions & 5 deletions src/bundler/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@ export interface BundlerDevOptions {

export function createBundler(opts: BundlerOpts): Bundler {
async function getBundler() {
// TODO: why need double .default?
if (opts.bundler === BundlerType.MAKO) {
// @ts-expect-error
return (await import('./bundler_mako.js')).default.default;
return (await import('./bundler_mako.js')).default;
} else if (opts.bundler === BundlerType.WEBPACK) {
// @ts-expect-error
return (await import('./bundler_webpack.js')).default.default;
return (await import('./bundler_webpack.js')).default;
} else {
throw new Error(`Unsupported bundler ${opts.bundler}`);
}
Expand Down

0 comments on commit 1c26a12

Please sign in to comment.