-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Fixes #3329 - Fix duplicate CSS in production builds #3352
Conversation
…n builders. Updated production builds to use `ExtractTextPlugin` so styles are not built into JS.
make-webpack-config.js
Outdated
@@ -54,13 +54,12 @@ module.exports = function(rules, options) { | |||
|
|||
if( specialOptions.separateStylesheets ) { | |||
plugins.push(new ExtractTextPlugin({ | |||
filename: '[name].css' + (specialOptions.longTermCaching ? '?[contenthash]' : ''), | |||
filename: "[name].css" + (specialOptions.longTermCaching ? "?[contenthash]" : ""), |
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.
One "downside" to my changes: swagger-ui-bundle.css
and swagger-ui-standalone-preset.css
files are now generated with the build. We could "fix" that by changing the [name].css
to swagger-ui.css
.
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.
@owenconti, I'd like for that to be fixed before merging - in my mind, the dist folder contents are part of our public API surface, so we should avoid changing the file names if at all possible.
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.
@owenconti and I had an out-of-band conversation, and settled on hardcoding swagger-ui.css
.
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.
See my comment: #3352 (comment)
…329-duplicate-css
…unused .less files. Removed reference to less file in webpack config. Removed dependency on less-loader. Updated standalone and bundle builds to no longer compile any styles.
@shockey I pushed it a bit further than we discussed. Since all of the styles are built into I also noticed that there was only one |
# Conflicts: # make-webpack-config.js
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.
Ran a full build from scratch with this code, and the old file structure came back. CSS looks good, as usual.
LGTM!
Fixes #3329
Ping @shockey and @Minasokoni
separateStylesheets
totrue
in all of the dist config files