-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (53 loc) · 1021 Bytes
/
webpack.config.js
File metadata and controls
54 lines (53 loc) · 1021 Bytes
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
'use strict';
var webpack = require('webpack');
var path = require('path');
// Builds bundle usable inside <script>.
module.exports = {
context: __dirname,
mode: 'production',
entry: {
'app': './app.js'
},
output: {
path: path.join(__dirname, "/dist"),
filename: "[name].js",
libraryTarget: "umd",
library: "app",
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
cacheDirectory: true,
}
},
{
test: /\.(txt|html|css)$/,
type: 'asset/source'
}
]
},
resolve: {
fallback: {
util: require.resolve('util/')
}
},
devServer: {
static: {
directory: __dirname,
},
devMiddleware: {
publicPath: '/dist'
},
compress: true,
port: 4004,
open: '/index-dev.html'
},
optimization: {
minimize: true
},
};