Skip to content

Commit

Permalink
fix: fix cjs bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Feb 28, 2025
1 parent 5b7ce43 commit edc57e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import pkg from '../package.json';

const name = 'tdesign';
const esExternalDeps = Object.keys(pkg.dependencies || {});
const externalDeps = esExternalDeps.concat([/lodash/, /@babel\/runtime/]);
const externalDeps = esExternalDeps.concat([/@babel\/runtime/]);
const externalPeerDeps = Object.keys(pkg.peerDependencies || {});
const banner = `/**
* ${name} v${pkg.version}
Expand Down Expand Up @@ -207,10 +207,13 @@ const libConfig = {
},
};

const cjsExternalException = ['lodash-es'];
const cjsExternal = externalDeps.concat(externalPeerDeps).filter((value) => !cjsExternalException.includes(value));

/** @type {import('rollup').RollupOptions} */
const cjsConfig = {
input: inputList,
external: externalDeps.concat(externalPeerDeps),
external: cjsExternal,
plugins: [multiInput()].concat(getPlugins()),
output: {
banner,
Expand Down

0 comments on commit edc57e1

Please # to comment.