Last active
December 5, 2017 08:51
-
-
Save superfine/a375fb180987c2c7515c77452d78dec7 to your computer and use it in GitHub Desktop.
Grunt build task with force options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Grunt build task with force options via stackoverflow | |
* | |
*/ | |
module.exports = function(grunt) { | |
const previous_force_state = grunt.option('force'); | |
grunt.registerTask('force', function(set) { | |
if (set === 'on') { | |
grunt.option('force', true); | |
} else if (set === 'off') { | |
grunt.option('force', false); | |
} else if (set === 'restore') { | |
grunt.option('force', previous_force_state); | |
} | |
}); | |
grunt.registerTask('build', [ | |
'force:on', | |
'clean:build', | |
'force:off', | |
'prettier', | |
'stylelint', | |
'sass', | |
'postcss', | |
'cssmin', | |
'eslint:prod', | |
'webpack', | |
'log' | |
]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment