-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
49 lines (47 loc) · 1.4 KB
/
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
45
46
47
48
49
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require("copy-webpack-plugin");
const path = require("path");
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
entry: ['@babel/polyfill', './src/index.js'],
output: {
path: path.resolve(process.cwd(), 'dist'),
filename: "bundle.js"
},
devServer: {
allowedHosts: ['.gitpod.io', 'github.io'],
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: ["babel-loader"]
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
},
{
test: /\.(png|jpg|gif|ico)$/,
loader: 'file-loader',
},
]
},
plugins: [
new CleanWebpackPlugin({
cleanStaleWebpackAssets: false,
}),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, "src", "index.html")
}),
new CopyPlugin({
patterns: [
{ from: "src/static" , to : "static"},
{ from: "src/libat.wasm"},
]
}),
new BundleAnalyzerPlugin({"openAnalyzer":false, "analyzerMode":"static"})
]
};