-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.prod.js
More file actions
42 lines (42 loc) · 1.01 KB
/
webpack.config.prod.js
File metadata and controls
42 lines (42 loc) · 1.01 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
34
35
36
37
38
39
40
41
42
var webpack = require('webpack');
var htmlWebpackplugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require('path');
module.exports = {
context: path.join( __dirname, './src'),
entry:{
app: './index.jsx',
lib: [
'react',
'react-dom',
'react-router'
]
},
output: {
path:'./dist',
filename: '[name].js'
},
module: {
loaders: [
{
test: /\.less$/,
loader: ExtractTextPlugin.extract('style-loader','css-loader?modules&camelCase&importLoaders=1&localIdentName=[local]__[hash:base64:5]!less')
},
{
test: /\.css/,
loader: ExtractTextPlugin.extract('style-loader','css?modules&importLoaders=1&localIdentName=[local]__[hash:base64:5]')
},
{
test: /\.(js|jsx)$/,
loaders: ['react-hot', 'babel-loader']
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('lib', 'lib.[hash:5].js'),
new htmlWebpackplugin({
template: './index.html'
}),
new ExtractTextPlugin( '[name].[hash:5].css')
]
}