forked from 18F/analytics.usa.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
35 lines (33 loc) · 746 Bytes
/
webpack.config.js
File metadata and controls
35 lines (33 loc) · 746 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
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: './js/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'assets'),
},
watchOptions: {
ignored: '/node_modules/',
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: [path.resolve(__dirname, 'node_modules')],
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
{
test: /\.m?js$/,
exclude: [path.resolve(__dirname, 'node_modules')],
loader: 'eslint-loader',
enforce: 'pre',
},
],
},
optimization: {
minimizer: [new UglifyJsPlugin()],
},
};