File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,8 +17,14 @@ const baseConfig: Options & { target: Target[] } = {
1717 ...( npm_package_version ? { npm_package_version } : { } )
1818 } ,
1919 esbuildOptions : options => {
20+ // esbuild don't touch AMD but it also don't remove AMD glue code.
21+ // Some of our packages prefers AMD over CJS via UMD and it also use anonymous modules.
22+ // This combination conflict with RequireJS if it present in the system.
23+ // We are removing AMD glue code manually, just like how Rollup does.
24+ // Read more at https://github.com/evanw/esbuild/issues/1348.
25+ // Also https://github.com/rollup/plugins/blob/e1a5ef99f1578eb38a8c87563cb9651db228f3bd/packages/commonjs/src/transform-commonjs.js#L328.
26+ // Test case at /__tests__/html2/hosting/requirejs.html.
2027 options . define = options . define || { } ;
21-
2228 options . define . define = 'undefined' ;
2329 options . define [ 'define.amd' ] = 'undefined' ;
2430
You can’t perform that action at this time.
0 commit comments