Extracting common code

As part of best practice here, the generating of common code in every module of the loader process should be avoided. A better approach is to use a runtime file in the loader and generate a require statement process to any shared module. This better suits how Webpack parses code.

It is the essential purpose of Webpack to compile a project so that code is not duplicated, so this may go without saying, but the loaders themselves should do this and not leave it to the Webpack core processing. Otherwise, applications would be needlessly large or have needlessly long compilation times.

If you have experience in programming plugins, you may overlook this very obvious precept, but it is worth mentioning here as it is so essential to the operation and processes of Webpack.

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

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