Skip to content

Commit

Permalink
fixed file loader and production builder
Browse files Browse the repository at this point in the history
  • Loading branch information
tahnik committed Sep 7, 2017
1 parent 54f1ee5 commit 8e4fa3d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
6 changes: 5 additions & 1 deletion client/src/components/list_item_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ class ListItemView extends Component {
ListItemView.propTypes = {
viewItem: PropTypes.func.isRequired,
match: PropTypes.object.isRequired,
item: PropTypes.object.isRequired,
item: PropTypes.object,
};

ListItemView.defaultProps = {
item: null,
};

export default ListItemView;
19 changes: 12 additions & 7 deletions webpack/client.prod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

Expand All @@ -12,6 +13,7 @@ module.exports = {
output: {
path: path.join(__dirname, '../server/public'),
filename: './js/index.js',
publicPath: '/',
},
module: {
rules: [{
Expand All @@ -33,18 +35,21 @@ module.exports = {
},
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'file-loader',
options: {
outputPath: 'images/',
}
use: [{
loader: 'file-loader',
options: {
outputPath: 'images/',
}
]
}]
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new UglifyJSPlugin({
sourceMap: true
}),
Expand Down
6 changes: 6 additions & 0 deletions webpack/server.prod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const nodeExternals = require('webpack-node-externals');

Expand Down Expand Up @@ -40,6 +41,11 @@ module.exports = {
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new UglifyJSPlugin({
sourceMap: true
}),
Expand Down

0 comments on commit 8e4fa3d

Please sign in to comment.