webpack -- five core concepts, basic usage and packaging
webpack
webpack is a front-end resource component tool, a static module bundler. Compile syntax that the browser does not recognize into syntax that the browser can recognize
From the perspective of webpack, many resource files (js/json/css/img/less) in the front end will be processed as modules. It will conduct static analysis according to t ...
Added by troublemaker on Tue, 21 Sep 2021 00:40:13 +0300
Node.js from getting started to giving up
Using fs module
import fs from 'fs'
// Common methods of fs module
fs.writeFile() // write file
fs.appendFile() // Write file for append
fs.readFile() // Read the file, and the read data is of buffer type
fs.unlink() // Delete file
fs.rename() // Rename or cut files
fs.stat() // Determine file or directory
fs.readdir() // ...
Added by atticus on Mon, 20 Sep 2021 13:40:00 +0300
Among cookie s, session and token, why choose token
Statement: This article is only for study and research. It is prohibited to use it for illegal purposes. Otherwise, you will bear the consequences. If there is infringement, please inform us to delete it. Thank you!
preface:
Why is token used? Because cookie s and session s have their own shortcomings, which limit the implementation of some f ...
Added by shibbi3 on Mon, 20 Sep 2021 12:38:07 +0300
From project construction to plug-in publishing to npm
preface
In our usual development work, we can pull out many common components and methods and publish them in the form of npm plug-ins on npm or our own npm private library to achieve the reuse effect.
Taking a react plug-in as an example, this article will go through a series of steps, such as development project construction, plug-in writin ...
Added by drummerboy on Wed, 15 Sep 2021 21:55:43 +0300
koa Routing Nursery Level Tutorial
# koa Routing Nursery Level Tutorial
Time: 11 September 2021
Author: Wu Yefei
---
In this series, I'll build projects from scratch to show you how to transform from the most basic routing writing to best practices. You'll see everything from writing all routes in app.js to pulling routes out, to routing auto-introduction and auto-re ...
Added by ++Sti++ on Sat, 11 Sep 2021 19:54:33 +0300
[acquisition technology] on the cancellation of repeated http requests
Scenario:
As developers, we mostly contact CRUD and joint debugging of various interfaces, but we seem to pay less attention to the http request we send. When the request is not fully completed and a new request is sent, how should we deal with the current request? We know that in order to prevent repeated actions, we can use anti shake and th ...
Added by EY on Sat, 11 Sep 2021 09:16:11 +0300
10 great JavaScript shorthand skills, learn css front-end development
let apples = ['๐', '๐'];
let fruits = ['๐ฅญ', '๐', '๐'];
// Add all items from apples onto fruits at start
Array.prototype.unshift.apply(fruits, apples)
console.log( fruits );
//=> ["๐", "๐", "๐ฅญ", "๐", "๐"]
Now the red and green apples will merge at the beginning, not at the end.
Abbreviation:
We can still shorten ...
Added by biopv on Fri, 10 Sep 2021 11:16:00 +0300
Nuxt, web game development tutorial
// ant-design-vue/lib/button/style/index.js
'use strict';
require('../../style/index.less');
require('./index.less');
// ant-design-vue/lib/button/style/css.js
'use strict';
require('../../style/index.css');
require('./index.css');
// ant-design-vue/es/button/style/index.js
import '../../style/index.less';
import './index.less';
...
Added by holowugz on Fri, 10 Sep 2021 06:26:00 +0300
Detailed explanation of the sequence of setTimeout, setInterval, promise and async/await (in many cases, very detailed ~)
This article is very long and lists a lot of situations. Before reading this article, if you have enough time, please create a new project to practice with this article. Each piece of code has a detailed explanation, but the impression will be deeper if you try it yourself~
setInterval: indicates how often it is executed. clearInterval(timer ...
Added by palpie on Sat, 04 Sep 2021 21:42:54 +0300
Vue.js knowledge - configuration of webpack, loader and Vue
Basic use of webpack
webpack version: 3.6.0
Create two folders under the file:
src, source filedist to store the packaged files
src folder: write two files
Main.js (entry file) (import method of CommonJS)
const {add,mul} = require("./aaa.js")
console.log(add(20,30));
console.log(mul(20,20));
aaa. File: imported file
function add( ...
Added by d-woo on Fri, 03 Sep 2021 23:53:22 +0300