-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.build.js
46 lines (45 loc) · 1.17 KB
/
webpack.config.build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const HtmlWebpackPlugin = require('html-webpack-plugin')
var path = require("path")
module.exports = {
entry: './src/hapnet.js', //打包文件入口
output: { //打包文件出口
path: path.resolve(__dirname,'./dist'),
filename: 'hap-net.js'
},
// devServer: {
// static: path.resolve(__dirname, "./examples"),
// port:7002,
// host:'0.0.0.0'
// },
mode:"production",
// plugins: [
// new HtmlWebpackPlugin({
// filename:'index.html',
// template:'./test/index.html'
// }),
//
// ],
module: {
rules: [
{
test: /\.css$/, //正则表达式,匹配文件类型
use: [
{ loader: 'style-loader' }, //申明使用什么loader进行处理
{ loader: 'css-loader' }, //申明使用什么loader进行处理
]
},
{
test: /\.(svg|eot|woff|ttf|woff2?)$/,
type: "asset",
// generator: {
// filename: "static/media/[hash:8][ext][query]",
// },
parser:{
dataUrlCondition:{
maxSize : 100 * 1024 *100
}
}
}
]
}
}