-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
62 lines (54 loc) · 1.44 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
50
51
52
53
54
55
56
57
58
59
60
61
62
const path = require('path');
const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
const mode = process.env.WEBPACK_MODE;
module.exports = {
// The point or points where to start the application bundling process.
entry: './js/app.js',
output: {
// This option determines the name of each output bundle.
filename: 'scripts.min.js',
// The bundle is written to the directory specified by the output.path option.
path: path.resolve(__dirname, 'js'),
},
// This option controls if and how source maps are generated.
devtool: 'source-map',
// Turn on watch mode.
// This means that after the initial build, webpack will continue to watch for changes in any of the resolved files.
watch: mode === 'production' ? false : true,
watchOptions: {
ignored: ['node_modules/**']
},
plugins: [
// Display OS-level notifications for Webpack build errors and warnings.
new WebpackBuildNotifierPlugin({
//title: 'Ground',
//message: 'Hello, there!',
sound: false,
failureSound: 'Bottle',
logo: path.join(__dirname, 'img/icon.png'),
contentImage: path.join(__dirname, 'img/icon.png')
}),
],
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "entry",
corejs: '3'
}
]
]
}
}
}
],
},
};