UNPKG

@domoinc/multiline-chart

Version:

MultiLineChart - Domo Widget

96 lines (89 loc) 2.71 kB
module.exports = function (grunt) { 'use strict'; // Project configuration var webpackConfig = require("./webpack.config.js"); grunt.initConfig({ // Metadata pkg: grunt.file.readJSON('package.json'), banner: '/*! <%= grunt.template.today("yyyy-mm-dd") %>\n' + '* Copyright (c) <%= grunt.template.today("yyyy") %> Domo Apps Team;*/\n', // Task configuration concat: { options: { banner: '<%= banner %>', stripBanners: true }, dist: { src: ['Bookends/start.js', 'js/*.js', 'Bookends/end.js'], dest: 'utils.js' } }, uglify: { options: { banner: '<%= banner %>' }, dist: { src: '<%= concat.dist.dest %>', dest: 'utils.min.js' } }, jshint: { options: { jshintrc: '.jshintrc', reporter: require('jshint-stylish') }, main: { src: ['js/*.js'] }, gruntfile: { src: 'gruntfile.js' } }, watch: { main: { files: '<%= jshint.main.src %>', tasks: ['jshint:main', 'concat', 'uglify'] }, gruntfile: { files: '<%= jshint.gruntfile.src %>', tasks: ['jshint:gruntfile'] } }, release: { options: { file: 'bower.json', //default: package.json additionalFiles: ['package.json'], //default: package.json beforeRelease: ['default', 'webpack'], npm: true, npmtag: false, //default: no tag tagName: 'v<%= version %>' } }, webpack: { options: webpackConfig, build: {} } }); // These plugins provide necessary tasks require('load-grunt-tasks')(grunt); // Default task grunt.registerTask('default', ['concat', 'uglify']); // Deploy to Github with tags grunt.registerTask('push', function(release){ if (release) { release = release.toLowerCase(); } if (release === 'patch') { grunt.task.run(['release:patch']); } else if (release === 'minor') { grunt.task.run(['release:minor']); } else if (release === 'major') { grunt.task.run(['release:major']); } else { console.log('Use one of the following commands to push'); console.log('grunt push:major'); console.log('grunt push:minor'); console.log('grunt push:patch'); } }); };