update
This commit is contained in:
@@ -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')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user