webpack4:基本使用
2021-08-17 05:58
标签:ati view viewport product cli 技术 项目 har ack webpack是基于Node构建,所以wepack支持所有Node API和语法。 即:Chrome浏览器能支持的ECMAScript语法(排除DOM、BOM),wbpack都能支持。Chrome不支持ES6,所以webpack也不支持。 创建基本的webpack4.x项目: 创建后的目录: 其中: package.json: { "name": "wp4-1", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "webpack": "^4.41.5", "webpack-cli": "^3.3.10" } } webpack.config.js: module.exports = { mode: ‘production‘ // development 或 production } index.js: console.log("hello webpack4.0!"); index.html: Document cmd中运行“webpack”命令打包。webpack4:基本使用标签:ati view viewport product cli 技术 项目 har ack 原文地址:https://www.cnblogs.com/samve/p/12331663.html