Skip to content

Commit

Permalink
webpack optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
nosovsh committed Oct 8, 2015
1 parent fd9081c commit 8a01e09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"dependencies": {
"async": "^0.9.0",
"autoprefixer": "^6.0.3",
"babel-core": "^5.1.10",
"babel-loader": "^5.0.0",
"blueimp-file-upload": "^9.9.3",
"css-loader": "^0.9.1",
"extract-text-webpack-plugin": "^0.3.8",
Expand Down Expand Up @@ -37,15 +39,11 @@
"react": "^0.13.3",
"react-components": "^0.2.0",
"react-router": "^1.0.0-rc1",
"react-slick": "^0.4.1",
"react-tap-event-plugin": "^0.1.7",
"sass-loader": "^2.0.1",
"slick-carousel": "^1.5.2",
"source-map": "^0.4.0",
"style-loader": "^0.8.3",
"webpack": "^1.8.9",
"babel-core": "^5.1.10",
"babel-loader": "^5.0.0"
"webpack": "^1.8.9"
},
"devDependencies": {
"babel-eslint": "^4.1.3",
Expand All @@ -60,7 +58,7 @@
},
"scripts": {
"dev": "node server.js",
"postinstall": "node_modules/.bin/webpack -dp --config webpack.deploy.config",
"postinstall": "node_modules/.bin/webpack -p --config webpack.deploy.config",
"lint": "eslint .",
"csslint": "csscomb . --verbose"
},
Expand Down
2 changes: 1 addition & 1 deletion server/motoparking/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<script src='http://localhost:3005/build/main.js'></script>
{% else %}
<script src='/static/build/main.js'></script>
{# <link rel="stylesheet" href="/static/build/main.css" />#}
<link rel="stylesheet" href="/static/build/styles.css" />
{% endif %}
<script>
flux.actions.manualUpdateCurrentUser({{ current_user_json_str|safe }});
Expand Down
12 changes: 9 additions & 3 deletions webpack.deploy.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
var config = require("./webpack.config");
var webpack = require("webpack");
var path = require("path");
var ExtractTextPlugin = require("extract-text-webpack-plugin");

config.devtool = false;

config.entry = [
"./entry.jsx"
Expand All @@ -16,18 +19,21 @@ config.output = {
config.module = {
loaders: [
// Pass *.jsx files through jsx-loader transform
{test: /\.jsx$/, exclude: "/node_modules/", loaders: ["babel-loader"]},
{test: /\.css$/, loader: "style!css"},
{test: /\.jsx$/, exclude: "/node_modules/", loaders: ["babel"]},
{test: /\.css$/, loader: ExtractTextPlugin.extract("style", "css!postcss")},
{test: /\.png$/, loader: "file"},
{test: /\.jpg$/, loader: "file"},
{test: /\.(ttf|eot|svg|woff|ttf)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader"}
{test: /\.(ttf|eot|svg|woff|ttf)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file"}
// { test: "png|jpg|jpeg|gif|svg", loader: "url-loader?limit=10000",}

]
};

config.plugins = [
new webpack.optimize.UglifyJsPlugin({minimize: true}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new ExtractTextPlugin("styles.css"),
new webpack.DefinePlugin({
GA_TRACKING_CODE: JSON.stringify("UA-59996600-1"),
DEBUG: false,
Expand Down

0 comments on commit 8a01e09

Please sign in to comment.