Webpack 5 resolve.alias and webpack.ProvidePlugin #13488
-
here the error
https://webpack.js.org/blog/2020-10-10-webpack-5-release/#changes-to-the-structure
the blog link explains the migration but it confusing for normal developers what should I have to do? after search, I found this medium link but still no result https://sanchit3b.medium.com/how-to-polyfill-node-core-modules-in-webpack-5-905c1f5504a0 resolve: {
//extensions: ['.js'],
alias: {
process: "process/browser",
jquery: path.resolve('node_modules', 'jquery/dist/jquery.js'),
}
},
new webpack.ProvidePlugin({
process: 'process/browser',
'$': 'jquery',
'jQuery': 'jquery',
'window.jQuery': 'jquery',
}), how to handle babel polyfills in these codes not helping to register jquery globally import $ from 'jquery';
window.$ = window.jQuery = $; |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
hm, maybe this error from custom plugin without configuration hard to say there is a problem |
Beta Was this translation helpful? Give feedback.
-
sry it's was problem with but what is best babel config for webpack 5 |
Beta Was this translation helpful? Give feedback.
-
use or other ways like other polyfills instead of babel polyfills
|
Beta Was this translation helpful? Give feedback.
hm, maybe this error from custom plugin without configuration hard to say there is a problem