e239e5eef9e79789a78a091869cdb3bf1fd5608c
[Packages/TYPO3.CMS.git] / Build / Gruntfile.js
1 /*
2 * This file is part of the TYPO3 CMS project.
3 *
4 * It is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License, either version 2
6 * of the License, or any later version.
7 *
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
10 *
11 * The TYPO3 project - inspiring people to share!
12 */
13
14 module.exports = function(grunt) {
15
16 // Project configuration.
17 grunt.initConfig({
18 pkg: grunt.file.readJSON('package.json'),
19 paths: {
20 root : "../",
21 t3skin : "<%= paths.root %>typo3/sysext/t3skin/Resources/",
22 core : "<%= paths.root %>typo3/sysext/core/Resources/"
23 },
24 less: {
25 t3skin: {
26 options: {
27 outputSourceFiles: true
28 },
29 src : '<%= paths.t3skin %>Private/Styles/t3skin.less',
30 dest: '<%= paths.t3skin %>Public/Css/visual/t3skin.css'
31 }
32 },
33 watch: {
34 less: {
35 files: '<%= paths.t3skin %>Private/Styles/**/*.less',
36 tasks: 'less'
37 }
38 },
39 bowercopy: {
40 options: {
41 clean: false,
42 report: false,
43 runBower: false,
44 srcPrefix: "<%= paths.core %>Contrib/components/"
45 },
46 all: {
47 files: {
48 '<%= paths.core %>Public/JavaScript/Contrib/requirejs/': '/requirejs/require.js',
49 '<%= paths.core %>Public/JavaScript/Contrib/moment/': '/moment/moment.js'
50 }
51 }
52 }
53 });
54
55 // Register tasks
56 grunt.loadNpmTasks('grunt-contrib-less');
57 grunt.loadNpmTasks('grunt-contrib-watch');
58 grunt.loadNpmTasks('grunt-bowercopy');
59 grunt.loadNpmTasks('grunt-npm-install');
60 grunt.loadNpmTasks('grunt-bower-just-install');
61
62
63 /**
64 * grunt update task
65 *
66 * call "$ grunt update"
67 *
68 * this task does the following things:
69 * - npn install
70 * - bower install
71 * - copy some bower components to a specific destinations because they need to be included via PHP
72 */
73 grunt.registerTask('update', ['npm-install', 'bower_install', 'bowercopy']);
74 };