Skip to content

Commit 829e70f

Browse files
haretonjmeta-codesync[bot]
authored andcommitted
Add umdNamedDefine: true to webpack UMD output
Summary: The `clientParamBuilder.bundle.js` UMD bundle uses an anonymous `define()` call, which conflicts with RequireJS on pages like Magento 2 checkout. When RequireJS is present, it intercepts the anonymous `define([], factory)` instead of letting the module register on `window`, causing `clientParamBuilder` to be undefined and breaking checkout JS. Adding `umdNamedDefine: true` changes the output from `define([], t)` to `define('clientParamBuilder', [], t)`, which prevents RequireJS from hijacking the module as an unresolvable anonymous definition. Fixes: #28 Ref: facebook/GoogleTagManager-WebTemplate-For-FacebookPixel#31 Reviewed By: ppwang-sa Differential Revision: D105386494 fbshipit-source-id: 0459a19bc096f8ad31f57bbc7db03d6a0a0994b9
1 parent fb55555 commit 829e70f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

client_js/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module.exports = {
1818
filename: `[name].bundle.js`,
1919
library: `[name]`,
2020
libraryTarget: `umd`,
21+
umdNamedDefine: true,
2122
},
2223
resolve: {
2324
extensions: [`.js`],

0 commit comments

Comments
 (0)