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

Feature/disable prod minification #208

Merged
merged 4 commits into from
May 19, 2017
Merged

Feature/disable prod minification #208

merged 4 commits into from
May 19, 2017

Conversation

gil--
Copy link
Contributor

@gil-- gil-- commented May 11, 2017

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 run gulp 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

"disableSuffix": "true",

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.

screen shot 2017-05-11 at 4 49 24 pm

@@ -26,6 +26,7 @@
"parent": "blank",
"stylesDir": "web/css",
"postcss": ["plugins.autoprefixer()"],
"disableSuffix": "true",
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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.

Copy link
Contributor Author

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

@Igloczek Igloczek merged commit 858e75f into SnowdogApps:develop May 19, 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