Advertisement
Guest User

webpack-gruntfile

a guest
May 20th, 2015
946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2.  
  3. var common = require('./webpack.common');
  4. var webpack = require('webpack');
  5. var merge = require('merge');
  6.  
  7. var webpackConfig = merge(true, common);
  8. webpackConfig.plugins.push(new webpack.IgnorePlugin(/vertx/));
  9. webpackConfig.devtool = 'source-map';
  10. webpackConfig.watch = true;
  11. webpackConfig.keepalive = true;
  12. webpackConfig.stats = {colors: true};
  13.  
  14.  
  15. module.exports = function (grunt) {
  16.  
  17.     grunt.initConfig({
  18.         clean: ['build'],
  19.         concurrent: {
  20.             dev: ['nodemon:app', 'webpack:dev'],
  21.             options: {
  22.                 logConcurrentOutput: true
  23.             }
  24.         },
  25.         jshint: {
  26.             all: [
  27.                 '*.js',
  28.                 '{actions,configs,components,services,stores}/**/*.js'
  29.             ],
  30.             options: {
  31.                 jshintrc: true
  32.             }
  33.         },
  34.         nodemon: {
  35.             app: {
  36.                 script: './server.js',
  37.                 options: {
  38.                     ignore: ['build/**', 'node_modules/'],
  39.                     ext: 'js,jsx'
  40.                 }
  41.             }
  42.         },
  43.         webpack: {
  44.             dev: webpackConfig
  45.         }
  46.     });
  47.  
  48.     // libs
  49.     grunt.loadNpmTasks('grunt-contrib-clean');
  50.     grunt.loadNpmTasks('grunt-contrib-jshint');
  51.     grunt.loadNpmTasks('grunt-concurrent');
  52.     grunt.loadNpmTasks('grunt-nodemon');
  53.     grunt.loadNpmTasks('grunt-webpack');
  54.  
  55.     // tasks
  56.     grunt.registerTask('default', ['clean', 'concurrent:dev']);
  57. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement