-
Notifications
You must be signed in to change notification settings - Fork 142
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
Feature/disable prod minification #208
Feature/disable prod minification #208
Conversation
config/themes.json.sample
Outdated
@@ -26,6 +26,7 @@ | |||
"parent": "blank", | |||
"stylesDir": "web/css", | |||
"postcss": ["plugins.autoprefixer()"], | |||
"disableSuffix": "true", |
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.
true
should be a boolean, not string.
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.
Woops. Adjusted to a boolean
helper/scss.js
Outdated
@@ -5,7 +5,8 @@ module.exports = function(gulp, plugins, config, name, file) { // eslint-disable | |||
stylesDir = theme.stylesDir ? theme.stylesDir : 'styles', | |||
disableMaps = plugins.util.env.disableMaps || false, | |||
production = plugins.util.env.prod || false, | |||
postcss = []; | |||
postcss = [], | |||
disableSuffix = theme.disableSuffix ? true : 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.
It can be reduced to theme.disableSuffix || false
also keep the same aligning of =
as above.
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.
I shifted them all 1 more indent since the linter complained about 8 and not 6 spaces
Production mode
--prod
adds a .min suffix which breaks frontend CSS if you do not have the Minify CSS Files admin configuration setting turned on. For various reasons, we may not want to turn it on but still be able to rungulp styles
in production mode. This PR adds a theme config option to disable adding a filename suffix (.min) on a per theme basis.Simply add
to the themes.json file and .min won't be appended in production mode.
Maybe there is a better approach but this is what I came up with for now.