feat(webpack): support es module bundling (#10788)

This commit is contained in:
Nathan Walker
2025-09-18 13:03:17 -07:00
committed by GitHub
parent d6d3800884
commit 1e54baf198
20 changed files with 806 additions and 414 deletions

View File

@@ -50,6 +50,9 @@ export interface IWebpackEnv {
// print webpack stats (default: true)
stats?: boolean;
// enable commonjs modules (default: ES modules, esm)
commonjs?: boolean;
// misc
replace?: string[] | string;
watchNodeModules?: boolean;
@@ -158,10 +161,9 @@ export function chainWebpack(
* @param mergeFn An object or a function that optionally returns an object (can mutate the object directly and return nothing)
*/
export function mergeWebpack(
mergeFn: ((
config: Partial<webpack.Configuration>,
env: IWebpackEnv,
) => any) | Partial<webpack.Configuration>,
mergeFn:
| ((config: Partial<webpack.Configuration>, env: IWebpackEnv) => any)
| Partial<webpack.Configuration>,
) {
webpackMerges.push(mergeFn);
}