-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
33 lines (32 loc) · 1.06 KB
/
Copy pathwebpack.config.js
File metadata and controls
33 lines (32 loc) · 1.06 KB
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
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
pages: __dirname + '/src/main/js/index.js',
vendors: ['react', 'react-dom']
},
devtool: 'eval',
output: {
path: __dirname,
filename: './target/classes/assets/bundle.js'
},
module: {
loaders: [
{ test: /\.css$/, loader: ExtractTextPlugin.extract({fallback:'style-loader', use:['css-loader']}) },
{ test: /\.less$/, loader: ExtractTextPlugin.extract('css-loader!resolve-url-loader!less-loader?sourceMap') },
{ test: /\.js[x]?$/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192&name=img/[name].[ext]' },
{ test: /\.(woff|woff2|eot|ttf|svg)(\?.*$|$)/, loader: 'url-loader' }
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendors',
filename: './target/classes/assets/vendors.js'
}),
new ExtractTextPlugin({
filename: './target/classes/assets/bundle.css',
allChunks: true
})
]
};