Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*global module */
- module.exports = function(grunt) {
- grunt.initConfig({
- pkg: grunt.file.readJSON('package.json'),
- meta: {
- banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
- '<%= grunt.template.today("yyyy-mm-dd") + "\\n" %>' +
- '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
- '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>; */ <%= "\\n" %>'
- },
- jshint: {
- all: ['_scripts/main/main.js', 'Gruntfile.js'],
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- boss: true,
- eqnull: true
- },
- globals: {
- exports: true,
- module: false,
- jQuery: false,
- $: false
- }
- },
- concat: {
- main: {
- src: ['_scripts/main/main.js'],
- dest: '_scripts/_debug/main.js'
- },
- language: {
- src: ['_scripts/main/language.js'],
- dest: '_scripts/language.js'
- },
- cookies: {
- src: ['_scripts/main/cookies.js'],
- dest: '_scripts/cookies.js'
- },
- pluginsCombine: {
- src: ['_scripts/plugins/combine/*.js'],
- dest: '_scripts/_debug/plugins.js'
- },
- allscripts: {
- src: ['_scripts/_debug/plugins.js', '_scripts/_debug/main.js'],
- dest: '_scripts/_debug/scripts.js'
- },
- iescripts: {
- src: ['_scripts/vendor/nwmatcher.js', '_scripts/vendor/selectivizr.js', '_scripts/vendor/ie-poly.js'],
- dest: '_scripts/_debug/ie.js'
- }
- },
- uglify: {
- options: {
- banner: '<%= meta.banner %>'
- },
- allscripts: {
- src: '_scripts/_debug/scripts.js',
- dest: '_scripts/scripts.min.js'
- },
- iescripts: {
- src: '_scripts/_debug/ie.js',
- dest: '_scripts/ie.min.js'
- },
- modules : {
- expand: true,
- src: '*.js',
- dest : '_scripts/plugins/modules/min/',
- cwd : '_scripts/plugins/modules/'
- }
- },
- less: {
- main: {
- options: {
- yuicompress: false
- },
- files: {
- '_styles/main.css': '_styles/less/_order.less'
- }
- },
- mainRtl: {
- options: {
- yuicompress: false,
- sourceMap: true,
- sourceMapFilename: '_styles/main.rtl.css.map',
- sourceMapRootpath: '/'
- },
- files: {
- '_styles/main.rtl.css': '_styles/less/_order.less'
- }
- },
- mainDebug: {
- options: {
- yuicompress: false,
- sourceMap: true,
- sourceMapFilename: '_styles/debug.main.css.map',
- sourceMapRootpath: '/'
- },
- files: {
- '_styles/debug.main.css': '_styles/less/_order.less'
- }
- },
- fonts: {
- options: {
- yuicompress: false
- },
- files: {
- '_styles/fonts.css': '_styles/less/fonts.less'
- }
- },
- ie: {
- options: {
- yuicompress: false
- },
- files: {
- '_styles/ie.css': '_styles/less/_order.less'
- }
- }
- },
- cmq: {
- main: {
- files: {
- '_styles/': '_styles/main.css'
- }
- },
- ie: {
- files: {
- '_styles/': '_styles/ie.css'
- }
- }
- },
- "comment-media-queries": {
- options: {
- // Task-specific options go here.
- },
- ie: {
- files: {
- '_styles/ie.css': '_styles/ie.css'
- }
- }
- },
- cssmin: {
- main: {
- src: '_styles/main.css',
- dest: '_styles/main.min.css'
- },
- mainRtl: {
- src: '_styles/main.rtl.css',
- dest: '_styles/main.rtl.min.css'
- },
- fonts: {
- src: '_styles/fonts.css',
- dest: '_styles/fonts.min.css'
- },
- ie: {
- src: '_styles/ie.css',
- dest: '_styles/ie.min.css'
- }
- },
- watch: {
- files: ['_scripts/plugins/*.js', '_styles/**/*.less', '_scripts/main/*.js', 'grunt.js'],
- tasks: ['jshint', 'concat', 'uglify', 'less', 'cmq', 'comment-media-queries', 'cssmin', 'copy', 'bump:build']
- },
- copy: {
- main: {
- files: [
- {expand: true, src: [
- 'images/**',
- '_templates/**',
- '!**/*.php'
- ], dest: '../src/GWR.DotCom/'},
- {expand: true, src: [
- '_styles/fonts/**',
- '_styles/*.min.css'
- ], dest: '../src/GWR.DotCom/'},
- {expand: true, src: [
- '_scripts/*.min.js',
- '_scripts/language.js',
- '_scripts/cookies.js',
- '_scripts/vendor/**',
- '_scripts/plugins/modules/min/**'
- ], dest: '../src/GWR.DotCom/'}
- ]
- }
- },
- bump: {
- options: {
- files: ['package.json'],
- updateConfigs: [],
- commit: false,
- createTag: false,
- push: false
- }
- }
- });
- grunt.loadNpmTasks('grunt-contrib-less');
- grunt.loadNpmTasks('grunt-contrib-concat');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-contrib-cssmin');
- grunt.loadNpmTasks('grunt-comment-media-queries');
- grunt.loadNpmTasks('grunt-combine-media-queries');
- grunt.loadNpmTasks('grunt-contrib-copy');
- grunt.loadNpmTasks('grunt-bump');
- // Default task.
- grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less','cmq', 'comment-media-queries', 'cssmin', 'copy', 'bump:build']);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement