Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Generate paths for this row.
var destPath = globalSettings.destPath + common.outputFolder + thisBundle.fileName + '.css',
sourcePath = thisBundle.srcPath + thisBundle.fileName + '.scss',
buildObject = {};
// Apply the generated dest / source paths to the build object.
buildObject.files = {};
buildObject.files[destPath] = sourcePath;
// Apply this specific build configuration to the overall SASS settings.
grunt.config.set('sass.' + uniqueBuildKey, buildObject);
}
// Compile SASS into CSS then prefix and save.
grunt.task.run(['sass', 'autoprefixer']);
});
var getTasks = module.exports.tasks = function (options) {
var opt = makeOptions(options);
var oldCwd = process.cwd();
var cwd = opt.base != null ? opt.base : oldCwd;
grunt.file.setBase(cwd);
var gruntCliDir = opt.base ? (opt.base + "/") : "";
grunt.task.init([]);
process.chdir(oldCwd);
var gruntTasks = grunt.task._tasks,
finalTasks = {};
var registerGruntTask = function (name) {
finalTasks[opt.prefix + name] = function (cb) {
if (opt.verbose) {
console.log('[grunt-gulp] Running Grunt "' + name + '" task...');
}
var args = opt.force ? [name, '--force', '--verbose=' + opt.verbose] : [name, '--verbose=' + opt.verbose];
for (var key in opt) {
if (key != 'base' && key != 'prefix') {
args = args.concat('--' + key + '=' + opt[key]);
}
function runTaskDirect(task, path, callback) {
//reload grunt module
require.uncache('grunt');
var grunt = require("grunt");
grunt.option('gruntfile', getGruntfilePath(path));
grunt.option('verbose', "true");
grunt.task.init([]);
grunt.task.run(task);
grunt.task.start();
}
function runCli(name, gruntfile) {
var fn;
if (typeof gruntfile === 'function') {
fn = gruntfile;
} else {
fn = require(path.resolve(gruntfile));
}
if (typeof fn === 'function') {
fn.call(grunt, grunt);
if (grunt.task._tasks[name]) {
grunt.option('gruntfile', gruntfile);
grunt.option('base', process.cwd());
var task = grunt.task;
var fail = grunt.fail;
var uncaughtHandler = function(e) {
fail.fatal(e, fail.code.TASK_FAILURE);
};
process.on('uncaughtException', uncaughtHandler);
task.options({
error: function(e) {
fail.warn(e, fail.code.TASK_FAILURE);
},
done: function() {
process.removeListener('uncaughtException', uncaughtHandler);
fail.report();
process.exit(0);
}
processGruntTemplate: function (string) {
var isProcessTemplateTrue = true;
if (grunt.task.current.data &&
grunt.task.current.data.options &&
typeof grunt.task.current.data.options.processTemplates !== 'undefined' &&
grunt.task.current.data.options.processTemplates === false) {
isProcessTemplateTrue = false;
}
return isProcessTemplateTrue ? grunt.template.process(string) : string;
}
task.phantomRunner = function(options,cb){
options = grunt.util._.extend({},defaultOptions,options);
var phantomReporters = [
grunt.task.getFile('jasmine/reporters/ConsoleReporter.js'),
grunt.task.getFile('jasmine/reporters/JUnitReporter.js')
],
port = (options.server && options.server.port) || 8888;
var url = URL.format({
protocol : 'http',
hostname : '127.0.0.1',
port : port + '',
pathname : path.join(baseDir,tmpRunner)
});
grunt.verbose.subhead('Testing jasmine specs via phantom').or.writeln('Testing jasmine specs via phantom');
jasmine.buildSpecrunner(baseDir, options, phantomReporters);
var server = startServer(baseDir, port);
runPhantom(url,options,phantomReporters.length,function(err,status){
grunt.registerTask('images', function() {
grunt.task.run(['imagemin', 'svgmin']);
});
function copyCards(value){
grunt.task.run('copy:cards');
return value;
}
grunt.registerTask('build', function() {
grunt.task.run(['styles', 'scripts', 'moveAssets']);
});