-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
44 lines (40 loc) · 1.32 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, 'src/main/resources/static/dist');
module.exports = {
devtool: 'source-map',
entry: {
app: SRC + '/index.jsx',
},
resolve: {
root: [
path.resolve(ROOT, 'javascript'),
path.resolve(ROOT, 'css')
],
extensions: ['', '.js', '.jsx']
},
output: {
path: DEST,
filename: 'bundle.js',
publicPath: '/dist/'
},
module: {
loaders: [
{
test: /\.jsx?$/,
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'}
]
}
};