-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (43 loc) · 930 Bytes
/
webpack.config.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
const path = require('path')
const CompressionPlugin = require('compression-webpack-plugin')
module.exports = {
entry: {
app: ['@babel/polyfill', './src/app.js']
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'app.bundle.js'
},
module: {
rules: [
// 处理js文件
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['@babel/preset-env'],
},
},
// 处理着色器语言
{
test: /\.(glsl|vs|fs|vert|frag)$/,
exclude: /node_modules/,
use: ['raw-loader'],
}
]
},
plugins: [new CompressionPlugin()],
devServer: {
contentBase: path.join(__dirname, ''),
compress: true,
watchContentBase: true,
port: 8082, // 端口
host: 'localhost', //IP
disableHostCheck: true,
},
// 配置node
node: {
fs: 'empty'
}
}