[front end Engineering] V: webpack5 quick start

webpack-dev-server To realize the automatic compilation and display of files modified during development, you can use the live server plug-in with webpack's watch attribute of true and vscode, that is, observation mode // webpack.config.js module.exports = { watch: true, ... } However, this has several disadvantages: All source cod ...

Posted by freshrod on Sun, 20 Feb 2022 12:03:27 +0100

webpack source code analysis series - loader

Why do I need a loader webpack is a static module packaging tool for modern JavaScript applications. Internally, one or more bundle static resources are generated by building the dependency relationship between dependency graph management modules. However, webpack can only handle JavaScript and Json modules. In addition to JavaScript and Jso ...

Posted by eXpertPHP on Thu, 17 Feb 2022 21:35:04 +0100

webpack5 learning and actual combat -- code separation

So far, there is only one bundle of files we have packaged js is such a js file. Then if the project is large, the js will become very large! This causes the first screen to take a very long time to load. Many of these codes do not need to be used immediately, which is a waste of resources. So we can separate the code and introduce it on demand ...

Posted by Deserteye on Tue, 15 Feb 2022 17:21:06 +0100

vue2.x notes 7-webpack details

Configuring vue in webpack If Vuejs is used in the project, it must be dependent, so it needs to be installed first. Because vue will also be used in the actual project later, it is not dependent during development, so it needs to be installed directly npm install vue@2.5.21 --save Use vue the way you learned before There is no error in t ...

Posted by pukstpr12 on Tue, 15 Feb 2022 04:28:17 +0100

webpack system learning Tree Shaking concept explanation

When the project reaches a certain volume, dividing the code into modules can be easier for us to manage. However, when doing so, we may introduce unnecessary code, and Tree Shaking is a method to optimize the volume by eliminating the code used in the file. Note: Tree Shaking only supports volume optimization for statically introduced modules. ...

Posted by seularts on Sun, 13 Feb 2022 13:23:49 +0100

Zhiting cloud disk - development guide web: project architecture

Here we mainly talk about the structure and technical architecture of the project, which is convenient for us to start development quickly 1. Technical structure of the project The project mainly adopts vue + webpack + vantMain purpose of the project vue-cli3 The scaffold shall be initialized, and then the structure shall be adjusted a ...

Posted by breadcom on Fri, 11 Feb 2022 14:55:12 +0100

Reduce Webpack packaging time

1.1 optimize Loader For the Loader, Babel must bear the brunt of affecting the packaging efficiency. Because Babel will convert the code into string to generate AST, then continue to transform the AST, and finally generate new code. The larger the project is, the more code is converted, and the lower the efficiency is. Of course, we have a ...

Posted by kycan on Fri, 11 Feb 2022 11:51:46 +0100

Using craco to optimize the construction of cra project

Modify the configuration of CRA project A project created with create react app cannot modify its internal webpack configuration by default. Unlike Vue cli, it can be modified through a configuration file. Although an eject command can completely expose the configuration, it is an irreversible operation and will lose the convenien ...

Posted by ajcrm125 on Wed, 09 Feb 2022 16:49:55 +0100

Learn more about Webpack - writing loader

How to write a Loader Official documentation: https://webpack.docschina.org/contribute/writing-a-loader/https://webpack.docschina.org/api/loaders/ Loader is just a JavaScript module exported as a function. This function is called when the loader converts resources. The given function will call loader API And accessed through this context. loa ...

Posted by Pryach on Wed, 09 Feb 2022 02:46:48 +0100

Do you know the three hash values packaged? I was stumped by this question when I was recruiting in our school!

prefaceHello, I'm Lin Sanxin. The most difficult knowledge point in the most easy to understand words is my motto. The foundation is advanced, and the premise is my original intentionSchool recruitment in those yearsI vaguely remember that when I participated in the school recruitment of a large factory, I interviewed Netease Leihuo studio. At ...

Posted by Koobazaur on Fri, 04 Feb 2022 04:45:03 +0100