-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
34 lines (33 loc) · 1.01 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
var path = require('path');
module.exports = {
// entrypoint for our javascript app
entry: './src/main/js/app.js',
// sourcemaps to link back to original source code
devtool: 'sourcemaps',
cache: true,
mode: 'development',
// the below element compiles all of our javascript into bundle.js, all the custom code AND dependencies
output: {
path: __dirname,
filename: './src/main/resources/static/built/bundle.js'
},
// hooking into babel engine using es2015 and react presets to compile ES6 React code
module: {
rules: [
{
test: path.join(__dirname, '.'),
exclude: /(node_modules)/,
use: [{
loader: 'babel-loader',
options: {
presets: ["@babel/preset-env", "@babel/preset-react"]
}
}]
},
{
test: /\.css$/,
use: ['css-loader'],
}
]
}
};