Skip to content

Commit

Permalink
split app and vendor code
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhenyao committed Jun 30, 2016
1 parent 602e8e6 commit 5503e22
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/containers/user/Profile.jsx
Expand Up @@ -64,7 +64,7 @@ export default class CropBoxExample extends React.Component {
]
return (
<span>
<div
{ profilePicture && <div
style={{
display: 'inline-block',
padding: 6,
Expand All @@ -82,7 +82,7 @@ export default class CropBoxExample extends React.Component {
backgroundRepeat: 'no-repeat',
backgroundImage: `url(${profilePicture})`
}} />
</div>
</div> }
<Dialog
title="修改头像"
contentStyle={{maxWidth: 600}}
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -57,7 +57,6 @@
"react-router": "^2.4.1",
"react-router-redux": "^3.0.0",
"react-tap-event-plugin": "^1.0.0",
"react-title-component": "^1.0.1",
"redux": "^3.3.1",
"redux-form": "^5.1.1",
"redux-immutablejs": "^0.0.8",
Expand Down
1 change: 1 addition & 0 deletions server/views/index.html
Expand Up @@ -12,5 +12,6 @@
</head>
<body>
</body>
<script type="text/javascript" src="/js/vendor.js"></script>
<script type="text/javascript" src="/js/index.js"></script>
</html>
20 changes: 20 additions & 0 deletions webpack/dev.config.js
Expand Up @@ -12,6 +12,25 @@ module.exports = {
},
entry: {
index: ['./client/index.js', hotMiddlewareScript],
vendor: [
'fastclick',
'immutable',
'nprogress',
'react',
'react-custom-scrollbars',
'react-dom',
'react-redux',
'react-router',
'react-router-redux',
'react-tap-event-plugin',
'redux',
'redux-form',
'redux-immutablejs',
'redux-thunk',
'simplestorage.js',
'superagent',
'validator'
]
},
output: {
path: path.join(__dirname, '..', 'public', 'js'), // absolute path!
Expand All @@ -36,6 +55,7 @@ module.exports = {
}
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
]
Expand Down
20 changes: 20 additions & 0 deletions webpack/pro.config.js
Expand Up @@ -10,6 +10,25 @@ module.exports = {
},
entry: {
index: './client/index.js',
vendor: [
'fastclick',
'immutable',
'nprogress',
'react',
'react-custom-scrollbars',
'react-dom',
'react-redux',
'react-router',
'react-router-redux',
'react-tap-event-plugin',
'redux',
'redux-form',
'redux-immutablejs',
'redux-thunk',
'simplestorage.js',
'superagent',
'validator'
]
},
output: {
path: path.join(__dirname, '..', 'public', 'js'), // absolute path!
Expand All @@ -34,6 +53,7 @@ module.exports = {
}
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
Expand Down

0 comments on commit 5503e22

Please sign in to comment.