I have used multiple node_modules in my project those are dependent on jquery such as materialize, jquery-validation etc.
I used webpack to build a single file so i can reduce number of request. All the dependencies uses different version of jquery libraries (mainly 2.4 and 3.1) Is there any option to combine all the jquery version to single code library.
For example: if I use 3 modules it create 3 different jquery modules in my build file.
How I can convert them in to single jquery version?
You can define in webpack's config to always resolve this dependency from certain location:
config.resolve = {
alias: {
"jquery": path.resolve(path.join(__dirname, "node_modules", "jquery"))
}
};
https://webpack.js.org/configuration/resolve/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With