-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathwebpack.production.config.js
More file actions
42 lines (40 loc) · 913 Bytes
/
webpack.production.config.js
File metadata and controls
42 lines (40 loc) · 913 Bytes
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 path = require('path');
var webpack = require('webpack');
var corePath = path.resolve(__dirname, 'core');
var node_modules_dir = path.resolve(__dirname, 'node_modules');
var reactPath = path.resolve(node_modules_dir, 'react', 'dist');
var publicPath = path.resolve(__dirname, 'public');
var config = {
entry: [
path.resolve(corePath, '_main.jsx')
],
context: corePath,
devtool: 'source-map',
output: {
filename: 'blog.js',
path: publicPath,
publicPath: '/public/'
},
module: {
loaders: [{
test: /\.jsx$/,
loaders: ['babel'],
exclude: [node_modules_dir]
}, {
test: /\.md$/,
loader: 'raw'
}, {
test: /\.css$/,
loader: 'style!css'
}, {
test: /\.json$/,
loader: 'json'
}]
},
plugins: [new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})]
};
module.exports = config;