Shimming

Shimming, or more specifically, shim-loaders. Now is a good time to explore this concept in detail since you'll need a firm grasp of it before you can move on.

The compiler that Webpack uses can understand modules written in ECMAScript 2015, CommonJS, or AMD. It should be noted that some third-party libraries may need global dependencies, for example, when using jQuery. These libraries may, in this case, need globals to be exported. This almost broken nature of the module is where shimming comes into effect.

Shimming can allow us to convert one language specification into another. In Webpack, this is usually done through dedicated loaders specific to your environment.

The principal concept behind Webpack is the use of modular development  isolated modules that are securely contained that don't rely on hidden or global dependencies  so it is important to note that the use of such dependencies should be sparse.

Shimming can be useful when you wish to polyfill browsers so that you can support multiple users. In this case, the polyfill only needs to be patched where needed and loaded on demand.

Shimming is related to patching but tends to take place in the browser, which makes it highly relevant to progressive web applications.

In the next section, we will look at progressive web applications in more detail – they are key to Webpack 5.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.20.238.187