module.exports = function (grunt) { var typo3_css = 'extension/Resources/Public/Css/'; var typo3_js = 'extension/Resources/Public/JavaScript/'; var typo3_fonts = 'extension/Resources/Public/fonts/'; // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), copy: { bootstrap: { files: [ { cwd: 'bower_components/bootstrap/dist/css/', src: [ 'bootstrap.min.css', 'bootstrap-theme.min.css' ], dest: typo3_css, filter: 'isFile', expand: true, flatten: true }, { cwd: 'bower_components/bootstrap/dist/js/', src: [ 'bootstrap.min.js' ], dest: typo3_js, expand: true, flatten: true }, { cwd: 'bower_components/bootstrap/dist/fonts/', expand: true, src: [ '*' ], dest: typo3_fonts, flatten: true } ] }, bootstrap_dev: { files: [ { cwd: 'bower_components/bootstrap/dist/css/', src: [ 'bootstrap.min.css', 'bootstrap-theme.min.css' ], dest: 'css/', filter: 'isFile', expand: true, flatten: true }, { cwd: 'bower_components/bootstrap/dist/js/', src: [ 'bootstrap.min.js' ], dest: 'js/', expand: true, flatten: true }, { cwd: 'bower_components/bootstrap/dist/fonts/', expand: true, src: [ '*' ], dest: 'fonts/', flatten: true } ] }, jquery: { files: [ { cwd: 'bower_components/jquery/dist/', src: [ 'jquery.min.js' ], expand: true, dest: typo3_js, flatten: true } ] }, jquery_devel: { files: [ { cwd: 'bower_components/jquery/dist/', src: [ 'jquery.min.js' ], expand: true, dest: "js/", flatten: true } ] }, jqwidgets: { files: [ { cwd: 'bower_components/jqwidgets/jqwidgets/', src: [ 'jqx-all.js' ], expand: true, dest: typo3_js, flatten: true }, { cwd: 'bower_components/jqwidgets/jqwidgets/styles/', src: [ 'jqx.base.css', 'jqx.darkblue.css' ], expand: true, dest: typo3_css, flatten: true }, { cwd: 'bower_components/jqwidgets/jqwidgets/styles/', src: [ 'images/**' ], expand: true, dest: typo3_css } ] }, jqwidgets_devel: { files: [ { cwd: 'bower_components/jqwidgets/jqwidgets/', src: [ 'jqx-all.js' ], expand: true, dest: 'js/', flatten: true }, { cwd: 'bower_components/jqwidgets/jqwidgets/styles/', src: [ 'jqx.base.css', 'jqx.darkblue.css' ], expand: true, dest: 'css/', flatten: true }, { cwd: 'bower_components/jqwidgets/jqwidgets/styles/', src: [ 'images/**' ], expand: true, dest: 'css/' } ] } }, uglify: { options: { banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n', }, build: { src: ['js/<%= pkg.name %>.debug.js'], dest: typo3_js + '<%= pkg.name %>.min.js' } }, jshint: { all: [ 'javascript/src/*.js' ] }, concat: { debug: { src: [ 'javascript/src/Helper/*.js', 'javascript/src/*.js' ], dest: 'js/<%= pkg.name %>.debug.js' } }, watch: { scripts: { files: [ 'javascript/src/*.js', 'javascript/src/Helper/*.js' ], tasks: [ 'default' ], options: { spawn: true } } } }); // Load the plugin that provides the "uglify" task. grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); // Default task(s). grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'copy']); };