-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
44 lines (41 loc) · 1.56 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
var path = require('path');
var webpack = require('webpack');
var ROOT = path.resolve(__dirname, 'src/main/resources/static');
var SRC = path.resolve(ROOT, 'javascript');
var DEST = path.resolve(__dirname, 'build/resources/main/static/javascript');
module.exports = {
devtool: 'source-map',
entry: {
app: SRC + '/index.jsx'
},
resolve: {
modules: [
path.resolve(ROOT, 'javascript'),
path.resolve(ROOT, 'css'),
'node_modules'
],
extensions: ['.js', '.jsx']
},
output: {
path: DEST,
filename: 'bundle.js',
publicPath: '/javascript/'
},
module: {
rules: [
{
test: /\.jsx?$/, // Notice the regex here. We're matching on js and jsx files.
loaders: ['babel-loader?presets[]=es2015&presets[]=react'],
include: SRC
},
{test: /\.css$/, loader: 'style-loader!css-loader'},
{test: /\.less$/, loader: 'style!css!less'},
// Needed for the css-loader when [bootstrap-webpack](https://github.com/bline/bootstrap-webpack)
// loads bootstrap's css.
{test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/font-woff'},
{test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/octet-stream'},
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file'},
{test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml'}
]
}
};