diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e346fb7d..8126675f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,9 +32,6 @@ importers: '@vercel/ncc': specifier: 0.33.3 version: 0.33.3 - babel-plugin-dynamic-import-node: - specifier: 2.3.3 - version: 2.3.3 babel-plugin-module-resolver: specifier: 4.1.0 version: 4.1.0 @@ -4325,12 +4322,6 @@ packages: - supports-color dev: true - /babel-plugin-dynamic-import-node@2.3.3: - resolution: {integrity: sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==} - dependencies: - object.assign: 4.1.4 - dev: false - /babel-plugin-istanbul@6.1.1: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} diff --git a/src/builder/bundle/index.ts b/src/builder/bundle/index.ts index 548a2d54..2cf8d7ea 100644 --- a/src/builder/bundle/index.ts +++ b/src/builder/bundle/index.ts @@ -31,7 +31,9 @@ interface IBundleOpts { incremental?: boolean; } -function bundle(opts: Omit): Promise; +function bundle( + opts: Omit, +): Promise; function bundle(opts: IBundleOpts): Promise; async function bundle(opts: IBundleOpts): Promise { const enableCache = process.env.FATHER_CACHE !== 'none'; @@ -111,7 +113,6 @@ async function bundle(opts: IBundleOpts): Promise { }, ], beforeBabelPlugins: [ - require.resolve('babel-plugin-dynamic-import-node'), ...(babelSCOpts ? [[require.resolve('babel-plugin-styled-components'), babelSCOpts]] : []), @@ -122,7 +123,11 @@ async function bundle(opts: IBundleOpts): Promise { // configure library related options chainWebpack(memo: any) { memo.output.libraryTarget('umd'); - + memo.merge({ + output: { + asyncChunks: false, + }, + }); if (config?.name) { memo.output.library(config.name); } @@ -165,21 +170,21 @@ async function bundle(opts: IBundleOpts): Promise { // enable webpack persistent cache ...(enableCache ? { - cache: { - buildDependencies: opts.buildDependencies, - }, - } + cache: { + buildDependencies: opts.buildDependencies, + }, + } : {}), // collect close handlers for watch mode ...(opts.watch ? { - onBuildComplete({ isFirstCompile, close }: any) { - if (isFirstCompile) closeHandlers.push(close); - // log for watch mode - else logStatus(); - }, - } + onBuildComplete({ isFirstCompile, close }: any) { + if (isFirstCompile) closeHandlers.push(close); + // log for watch mode + else logStatus(); + }, + } : {}), disableCopy: true, });