-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ts
53 lines (51 loc) · 1.25 KB
/
webpack.config.ts
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
import webpack from 'webpack';
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const config: webpack.Configuration = {
entry: {
'gh-optimization-client': `./src/optimization-client.ts`
},
output: {
path: `${__dirname}/dist/esm5`,
filename: '[name].bundle.js',
chunkFilename: '[name].chunk.js',
sourceMapFilename: '[name].js.map',
library: 'GHOptimization',
libraryTarget: 'window'
},
mode: 'development',
module: {
rules: [
{
test: /.+\.(j|t)s$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
optimization: {
splitChunks: {
chunks: 'all'
}
},
performance: {
hints: 'warning'
},
plugins: [
new CleanWebpackPlugin(['dist']),
new HtmlWebpackPlugin({
title: 'Development',
template: './test/index.html',
inject: 'head'
})
],
resolve: {
extensions: ['.wasm', '.mjs', '.ts', '.js', '.json']
},
stats: {
colors: true,
modules: true,
reasons: true
}
};
export default config;