Skip to content
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

Merged
merged 4 commits into from
Dec 11, 2017
Merged

Conversation

xD3CODER
Copy link
Contributor

@xD3CODER xD3CODER commented Dec 8, 2017

Added postcss-csso for css/scss minification
Added DEV_SERVER_HOST_URL directly in .env (dev server under subdomain support)

Added postcss-csso for css/scss minification
Added DEV_SERVER_HOST_URL directly in .env (dev server under subdomain support)
@calvinl
Copy link
Member

calvinl commented Dec 9, 2017

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",
Copy link
Member

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",
Copy link
Member

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",
Copy link
Member

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

@@ -1,5 +1,10 @@
const autoprefixer = require('autoprefixer');
const csso = require('postcss-csso')({restructure: true, comments: false});
Copy link
Member

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 }


// the clean options to use
let cleanOptions = {
root: '/var/www/react/',
Copy link
Member

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?

@@ -1,19 +1,39 @@
import webpack from 'webpack';
import baseConfig from './base';
import CompressionPlugin from 'compression-webpack-plugin';
import CleanWebpackPlugin from 'clean-webpack-plugin';
Copy link
Member

@calvinl calvinl Dec 11, 2017

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')),
Copy link
Member

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.

Copy link
Member

@calvinl calvinl left a 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!

@xD3CODER
Copy link
Contributor Author

Yeah i made few mistakes with my PR I update these

@calvinl calvinl merged commit 2ffd187 into combine:master Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants