-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.base.js
63 lines (60 loc) · 1.3 KB
/
webpack.config.base.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
target: 'web',
entry: {
index: path.resolve(__dirname, './src/index.ts'),
},
resolve: {
extensions: ['.ts', '.js'],
alias: {
'@src': path.resolve(__dirname, './src'),
'@': path.resolve(__dirname, './'),
},
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/index.html',
chunks: ['index']
}),
],
devServer: {
port: 3006,
host: 'localhost',
compress: true, // enable gzip compression
hot: true, // hot module replacement. Depends on HotModuleReplacementPlugin
https: false, // true for self-signed, object for cert authority
client: {
overlay: false,
},
},
output: {
library: {
type: 'umd',
name: 'hardwareHelper',
},
path: path.join(__dirname, './docs'),
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.glsl$/,
loader: 'webpack-glsl-loader',
},
{
test: /\.(png|jpeg|jpg|gif|svga|obj)$/,
loader: 'url-loader',
options: {
limit: 1024 * 1024 * 100 // 100M
}
},
],
},
stats: {},
}