Skip to content

Commit 9a653df

Browse files
committed
adds webpack.pro.config
1 parent 7136575 commit 9a653df

File tree

6 files changed

+24
-7
lines changed

6 files changed

+24
-7
lines changed

app/scripts/app.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../styles/base.css';
12
import React from 'react/addons';
23

34
let Hello = React.createClass({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"start": "NODE_ENV=production node server.js",
9-
"postinstall": "webpack -p --config ./webpack.config.js"
9+
"postinstall": "webpack -p --config webpack.pro.config.js --profile --progress --colors"
1010
},
1111
"author": "",
1212
"license": "ISC",

public/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<link rel="stylesheet" type="text/css" href="./styles/base.css">
65
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
76
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
87
<title>Node + React</title>

public/styles/base.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ module.exports = {
1313
{ test: /\.js$/, loader: "babel-loader?stage=0", exclude: '/node_modules/' },
1414
{ test: /\.jsx$/, loaders: ['jsx-loader', "babel-loader?stage=0"] }
1515
]
16-
}
16+
},
17+
plugins: []
1718
};

webpack.pro.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var config = require('./webpack.config.js');
2+
var webpack = require('webpack');
3+
4+
config.plugins.push(
5+
new webpack.DefinePlugin({
6+
"process.env": {
7+
"NODE_ENV": JSON.stringify("production")
8+
}
9+
})
10+
);
11+
12+
config.plugins.push(
13+
new webpack.optimize.UglifyJsPlugin({
14+
compress: {
15+
warnings: false
16+
}
17+
})
18+
);
19+
20+
module.exports = config;

0 commit comments

Comments
 (0)