Skip to content

Commit e5b072e

Browse files
committed
Fix jQuery not defined error. Need to define jQuery as shared module with eager loading along with the loading mechanism in index.js.
1 parent 911b542 commit e5b072e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

webpack.config.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = () => {
1919
});
2020
config.output.path = path.resolve(
2121
__dirname,
22-
"plonetheme/nuplone/static/bundle",
22+
"plonetheme/nuplone/static/bundle"
2323
);
2424

2525
config.plugins.push(
@@ -30,7 +30,15 @@ module.exports = () => {
3030
...package_json_patternslib.dependencies,
3131
...package_json.dependencies,
3232
},
33-
}),
33+
shared: {
34+
jquery: {
35+
singleton: true,
36+
requiredVersion:
37+
package_json_patternslib.dependencies["jquery"],
38+
eager: true,
39+
},
40+
},
41+
})
3442
);
3543

3644
if (process.env.NODE_ENV === "development") {

0 commit comments

Comments
 (0)