Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Extract CSS to file in production builds #3783

Merged
merged 4 commits into from Dec 10, 2016
Merged

Conversation

ngotchac
Copy link
Contributor

@ngotchac ngotchac commented Dec 9, 2016

Export all the CSS to a proper file if built in production environment.
This prevents a flash of unstyled content on first load.

NB : this is not possible in dev mode since hot reloading doesn't play nice with external CSS files

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. M7-ui labels Dec 9, 2016
@jacogr
Copy link
Contributor

jacogr commented Dec 9, 2016

Excuse my ignorance - but if gets added automagically to the index.html file

@ngotchac
Copy link
Contributor Author

ngotchac commented Dec 9, 2016

@jacogr Yep it does, as the JS files actually, thanks to HtmlWebpackPlugin

@jacogr
Copy link
Contributor

jacogr commented Dec 9, 2016

Cool. Will just build with --no-default-features --features ui in the morning to give it a run-through

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 85.595% when pulling 7591dcd on ng-webpack-extract-css into 341777d on master.

@jacogr
Copy link
Contributor

jacogr commented Dec 10, 2016

It seems to put the styles for everything in one, e.g.

from tokenreg.html - <link href="/styles.43f703cc4465bd69701b.css" rel="stylesheet"></head>
from index.html - <link href="/styles.43f703cc4465bd69701b.css" rel="stylesheet">

There needs to be a split between the UI, dapps and between the dapps.

Apart from that, seems to work as intended.

@jacogr jacogr added A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 10, 2016
@ngotchac
Copy link
Contributor Author

Ah that's right, I'll look into that

@ngotchac
Copy link
Contributor Author

Ok this should be fixed now. Each dapp has it's own CSS file. Plus some files are now in subfolders: assets for images, styles for CSS, fonts for... fonts.

Also fixed DAPPS_URL not being used everywhere ; now we can test the builds properly

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. and removed A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. labels Dec 10, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 85.604% when pulling ca9bff0 on ng-webpack-extract-css into 341777d on master.

@@ -82,28 +83,51 @@ module.exports = {
]
},

// // Don't extract CSS for Dapps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still want this in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@jacogr
Copy link
Contributor

jacogr commented Dec 10, 2016

Merge in master to just run the checks.

@jacogr jacogr added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 10, 2016
@jacogr jacogr merged commit b44e7bb into master Dec 10, 2016
@jacogr jacogr deleted the ng-webpack-extract-css branch December 10, 2016 22:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants