-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance prod minification #38
Conversation
Added postcss-csso for css/scss minification Added DEV_SERVER_HOST_URL directly in .env (dev server under subdomain support)
Thanks for this, will review over the weekend. |
package.json
Outdated
@@ -124,16 +125,19 @@ | |||
"redbox-react": "^1.5.0", | |||
"supertest": "^3.0.0", | |||
"webpack-dev-server": "^2.9.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this line?
package.json
Outdated
@@ -124,16 +125,19 @@ | |||
"redbox-react": "^1.5.0", | |||
"supertest": "^3.0.0", | |||
"webpack-dev-server": "^2.9.6", | |||
"webpack-dev-server": "^2.9.7", | |||
"webpack-sources": "^1.1.0" | |||
}, | |||
"dependencies": { | |||
"app-module-path": "^2.2.0", | |||
"autoprefixer": "^7.2.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line as well.
package.json
Outdated
"webpack-sources": "^1.1.0" | ||
}, | ||
"dependencies": { | ||
"app-module-path": "^2.2.0", | ||
"autoprefixer": "^7.2.1", | ||
"autoprefixer": "^7.2.2", | ||
"axios": "^0.17.1", | ||
"babel": "^6.23.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this. :)
Please also commit package-lock.json
postcss.config.js
Outdated
@@ -1,5 +1,10 @@ | |||
const autoprefixer = require('autoprefixer'); | |||
const csso = require('postcss-csso')({restructure: true, comments: false}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style should have spacing between curly braces, e.g.
{restructure: true, comments: false}
to
{ restructure: true, comments: false }
webpack/production.babel.js
Outdated
|
||
// the clean options to use | ||
let cleanOptions = { | ||
root: '/var/www/react/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't __dirname
be better here?
webpack/production.babel.js
Outdated
@@ -1,19 +1,39 @@ | |||
import webpack from 'webpack'; | |||
import baseConfig from './base'; | |||
import CompressionPlugin from 'compression-webpack-plugin'; | |||
import CleanWebpackPlugin from 'clean-webpack-plugin'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In production, this package is missing. Please add to package.json
.
server/server.js
Outdated
@@ -33,7 +33,7 @@ app.use(compression()); | |||
|
|||
// Add middleware to serve up all static files | |||
app.use('/dist', | |||
express.static(path.join(__dirname, '../dist')), | |||
express.static(path.join(__dirname, '../dist/public')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use process.env.WEBPACK_OUTPUT_PATH
here instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few (minor) changes. Looks good otherwise!
Yeah i made few mistakes with my PR I update these |
Added postcss-csso for css/scss minification
Added DEV_SERVER_HOST_URL directly in .env (dev server under subdomain support)