How to use the grunt.loadNpmTasks function in grunt

To help you get started, we’ve selected a few grunt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github popperjs / popper.js / Gruntfile.js View on Github external
var grunt = require('grunt');
var fs = require('fs');
var path = require('path');
var babel = require('rollup-plugin-babel');

var popperVersion = JSON.parse(fs.readFileSync('./package.json')).version;
var tooltipVersion = JSON.parse(fs.readFileSync('./src/tooltip/package.json')).version;

// comma separated list of browsers to run tests inside
var browsers = grunt.option('browsers') ? grunt.option('browsers').split(',') : ['ChromeDebug'];

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsdoc-to-markdown')
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-rollup');
grunt.loadNpmTasks('gruntify-eslint');

module.exports = function Gruntfile(grunt) {
    // Project configuration.
    grunt.initConfig({
        rollup: {
            options: {
                format: 'umd',
                sourceMap: true,
                plugins: () => [
                    babel(),
                ],
                globals: {
                    'popper.js': 'Popper',
                },
github popperjs / popper.js / Gruntfile.js View on Github external
'use strict';

var grunt = require('grunt');
var fs = require('fs');
var path = require('path');
var babel = require('rollup-plugin-babel');

var popperVersion = JSON.parse(fs.readFileSync('./package.json')).version;
var tooltipVersion = JSON.parse(fs.readFileSync('./src/tooltip/package.json')).version;

// comma separated list of browsers to run tests inside
var browsers = grunt.option('browsers') ? grunt.option('browsers').split(',') : ['ChromeDebug'];

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsdoc-to-markdown')
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-rollup');
grunt.loadNpmTasks('gruntify-eslint');

module.exports = function Gruntfile(grunt) {
    // Project configuration.
    grunt.initConfig({
        rollup: {
            options: {
                format: 'umd',
                sourceMap: true,
                plugins: () => [
                    babel(),
                ],
github aws-samples / aws-waf-sample / waf-bad-bot-blocking / Gruntfile.js View on Github external
Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

    http://aws.amazon.com/asl/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

/*jslint node: true */
"use strict";

// init Grunt
var grunt = require('grunt');

// load modules
grunt.loadNpmTasks('grunt-aws-lambda');

// define configuration
grunt.initConfig({
	pkg: grunt.file.readJSON('package.json'),
	lambda_invoke: {
		default: {
			options: {
				file_name: 'function.js',
				handler: 'handler',
				event: 'testing/event.json'
			}
		}
	},
	lambda_package: {
		default: {
			options: {
github mathigon / textbooks / gruntfile.js View on Github external
// (c) Mathigon
// =============================================================================



const grunt = require('grunt');
const rollup = require('rollup');
const rollupResolve = require('rollup-plugin-node-resolve');


// -----------------------------------------------------------------------------
// Plugins and Setup

grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
require('@mathigon/parser')(grunt);

grunt.registerMultiTask('rollup', '', function() {
  const done = this.async();

  function onwarn(error) {
    if (error.code !== 'CIRCULAR_DEPENDENCY') grunt.log.error(error.message);
  }

  const promises = this.files.map(f => {
    return rollup.rollup({input: f.src[0], plugins: [rollupResolve()], onwarn})
      .then(bundle => bundle.generate({format: 'iife', name: '_stepFunctions'}))
      .then(result => grunt.file.write(f.dest, result.output[0].code));
  });
github mai-kuraki / fluentApp / app / Gruntfile.js View on Github external
const grunt = require("grunt");
grunt.config.init({
    pkg: grunt.file.readJSON('package.json'),
    'create-windows-installer': {
        x64: {
            appDirectory: './fluentApp-win32-x64',
            authors: 'maikuraki.',
            exe: 'fluentApp.exe',
            description:"music app",
        }
    }
});

grunt.loadNpmTasks('grunt-electron-installer');
grunt.registerTask('default', ['create-windows-installer']);
/**
 * 样例文件,Gruntfile.js作用于fluentApp-win32-x64(构建后文件夹)
 */
github HuayraLinux / huayra-stopmotion / GruntFile.js View on Github external
dest: 'dist/',
    },
  },
  watch: {
    dev: {
      files: ['Gruntfile.js', 'src/js/**/*.js', 'src/**/*.html'],
      tasks: ['clear', 'jshint', 'concat:dist', 'copy'],
      options: {
        atBegin: true
      }
    },
  }
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-clear');
grunt.loadNpmTasks('grunt-contrib-copy');
github ericholiveira / studio / Gruntfile.js View on Github external
var grunt = require("grunt");

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-istanbul');
grunt.loadNpmTasks('grunt-browserify');

grunt.initConfig({
	watch: {
		scripts: {
			files: ['src/**/*.js', '*.js', 'tests/*.js'
			],
			tasks: ['all'],
			options: {
				spawn: false
			}
		}
	},
github ericholiveira / studio / Gruntfile.js View on Github external
var grunt = require("grunt");

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-istanbul');
grunt.loadNpmTasks('grunt-browserify');

grunt.initConfig({
	watch: {
		scripts: {
			files: ['src/**/*.js', '*.js', 'tests/*.js'
			],
			tasks: ['all'],
			options: {
				spawn: false
			}
		}
	},
	instrument: {
		files: ['src/**/*.js','tests/**/*.js'],
		options: {
			lazy: false,
github rehabstudio / fe-skeleton / run / tasks / styles / grunt.js View on Github external
'use strict';

/**
 *  Compiles, minifies and prefixes SASS.
 *
 *  Example Usage:
 *  grunt styles
 */

var grunt = require('grunt'),
    common = require('./_common'),
    globalSettings = require('../../_global');

grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');

grunt.config.set('sass', {
    options: common.sassSettings
});

grunt.config.set('autoprefixer', {
    dist: {
        expand: true,
        flatten: true,
        src: globalSettings.destPath + common.outputFolder + '*.css',
        dest: globalSettings.destPath + common.outputFolder
    },
    options: {
        browsers: common.autoPrefixSettings.browsers,
        map: true
github thedjpetersen / subway / lib / static.js View on Github external
report: "gzip"
          },
          main: {
            files: {
            }
          }
        }
      });

      grunt.config.data.uglify.main.files[min_stamp] = js_files;

      grunt.loadNpmTasks("grunt-styl");
      grunt.loadNpmTasks("grunt-react");
      grunt.loadNpmTasks("grunt-contrib-clean");
      grunt.loadNpmTasks("grunt-contrib-symlink");
      grunt.loadNpmTasks("grunt-contrib-jade");
      grunt.loadNpmTasks("grunt-contrib-uglify");

      callback(null);
    }
  ], function (err, result) {