In depth analysis of webpack
background
When it comes to building tools, I often add the word "automation" before it, because building tools are used to make us stop doing mechanical things and liberate our hands.
What is front-end automation? The code that front-end engineers need to maintain is extremely huge and complex, and the processes of code maintena ...
Added by lj11 on Sun, 30 Jan 2022 14:59:24 +0200
Webpack learning notes
1, Introduction to Webpack
1.1 what is webpack
webpack is a front-end resource building tool, a static module packer. From the perspective of webpack, all resource files (js | json | css | img | less...) of the front end will be processed as modules. It will carry out static analysis according to the dependency of the module and package the c ...
Added by Archy on Sun, 30 Jan 2022 09:35:04 +0200
Analysis of Webpack plugin
Webpack flowchart
Important steps:
init => run => compile => compilation => make => afterCompile => seal => codeGen => emit => done
plugin idea
The idea of plugin plug-in is to find a place to insert between the above steps. The method inserted and called uses the event model, hooks:
// Define an event / ...
Added by Todd_Z on Sun, 30 Jan 2022 00:41:02 +0200
The actual combat of vue3 project starts from 0
First check your current npm version. The version of vue3 needs to be greater than 3.0. It is recommended to install the latest npm
View version
`npm -v`
Upgrade or install cnpm
npm install cnpm -g`
Upgrade npm
`cnpm install npm -g`
Cnpm can work well with Webpack or Browserify module packer, so we recommend using cnpm, so we n ...
Added by webgod on Thu, 27 Jan 2022 20:29:00 +0200
Implement a webpack
Modularization cannot be used directly in browsers. Although Es Module is now supported, further conversion is needed. webpack can package our modules into bundle files to provide the syntax that the browser can recognize.
add.js file
exports.default = (a, b) => a + b;
index.js file
const add = require('add.js').default;
console.log(a ...
Added by swebajen on Wed, 26 Jan 2022 20:34:54 +0200
Packaging and automatic update of Electron application --- case practice, very detailed
In the last article, we introduced some basic knowledge of electron, Get started with Electron and teach you to write complete practical cases Here, we will continue to introduce the packaging and automatic update of Electron based on this project.
Generate Icon
Before packaging the application, prepare an icon for the application as the inst ...
Added by robvan75 on Tue, 25 Jan 2022 02:38:20 +0200
NPM nodejs and webpack installation
nodejs and npm
1, First, let's talk about node What is JS?
node.js is the running environment of JavaScript. It is not a js file. In essence, it is the encapsulation of Chrome V8 engine.
node.js is a development platform that enables JavaScript to run on the server, and makes it a scripting language with the same status as the server la ...
Added by Kyrillos on Mon, 24 Jan 2022 11:48:23 +0200
Implementation of micro front end with webpack 5 module Federation
Implementation of micro front end with webpack 5 module FederationMicro front end: split the huge single front-end system into multiple independent small systems, and finally integrate it into a system architecture idea, divide and rule, and make the systemIt is easier to maintain and expand. The implementation of micro front end is a process o ...
Added by hjunw on Mon, 24 Jan 2022 05:49:48 +0200
vue cli 2X tutorial
I Environment: NodeJs(npm)
There are no special operations for Mac. Next - > next - > install - > finishedwindows startup installation is the same as Mac terminal / cmdNode - V - > 14.16.2 indicates that the installation is successfulNPM - V - > 14.16.2 indicates that the installation is successfulwindows needs to modify the dow ...
Added by venkychinnu on Fri, 21 Jan 2022 19:51:10 +0200
It takes too long to load the home page project for the first time, and the packaged file is too large
Problem background: 1 It takes 2min to load the page for the first time. If it cannot be opened for half a day, a white screen will appear. After optimization, it will become 30s
2. The file after build is too large, such as a main JS file is 7.9M before optimization and 1.5 ...
Added by TobyRT on Fri, 21 Jan 2022 01:48:45 +0200