This commit is contained in:
asd
2019-12-01 18:55:40 +08:00
parent 629115d5ec
commit 83c34b90c2

View File

@@ -39,4 +39,36 @@ linux 系统 运行 yarn global bin 查看 yarn 的全局目录,然后 #expor
index.js 要压缩的js文件
package.json 应用的默认配置
>内容:
webpack.config
```
{
"name": "ceshi",
"version": "1.0.0",
"description": "wu",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --mode production",
"dev": "webpack --mode development"
},
"author": "aaa",
"license": "3000",
"private": false
}
```
webpack.config.js
>内容:
```
const path = require('path');
module.exports = {
// 入口js路径
entry: './src/index.js',
// 编译输出的js及路径
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
}
};
```