00bbdfbfc7d94a2f6f5ccf3a51052124444e1666
[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 /**
17 * Grunt stylefmt task
18 */
19 grunt.registerMultiTask('formatsass', 'Grunt task for stylefmt', function () {
20 var options = this.options(),
21 done = this.async(),
22 stylefmt = require('stylefmt'),
23 scss = require('postcss-scss'),
24 files = this.filesSrc.filter(function (file) {
25 return grunt.file.isFile(file);
26 }),
27 counter = 0;
28 this.files.forEach(function (file) {
29 file.src.filter(function (filepath) {
30 var content = grunt.file.read(filepath);
31 var settings = {
32 from: filepath,
33 syntax: scss
34 };
35 stylefmt.process(content, settings).then(function (result) {
36 grunt.file.write(file.dest, result.css);
37 grunt.log.success('Source file "' + filepath + '" was processed.');
38 counter++;
39 if (counter >= files.length) done(true);
40 });
41 });
42 });
43 });
44
45 // Project configuration.
46 grunt.initConfig({
47 pkg: grunt.file.readJSON('package.json'),
48 paths: {
49 resources: 'Resources/',
50 root: '../',
51 sass: '<%= paths.resources %>Public/Sass/',
52 sysext: '<%= paths.root %>typo3/sysext/',
53 form: '<%= paths.sysext %>form/Resources/',
54 frontend: '<%= paths.sysext %>frontend/Resources/',
55 install: '<%= paths.sysext %>install/Resources/',
56 linkvalidator: '<%= paths.sysext %>linkvalidator/Resources/',
57 backend: '<%= paths.sysext %>backend/Resources/',
58 t3editor: '<%= paths.sysext %>t3editor/Resources/',
59 workspaces: '<%= paths.sysext %>workspaces/Resources/',
60 ckeditor: '<%= paths.sysext %>rte_ckeditor/Resources/',
61 core: '<%= paths.sysext %>core/Resources/',
62 node_modules: 'node_modules/',
63 t3icons: '<%= paths.node_modules %>@typo3/icons/dist/'
64 },
65 stylelint: {
66 options: {
67 configFile: '<%= paths.root %>.stylelintrc',
68 },
69 sass: ['<%= paths.sass %>**/*.scss']
70 },
71 formatsass: {
72 sass: {
73 files: [{
74 expand: true,
75 cwd: '<%= paths.sass %>',
76 src: ['**/*.scss'],
77 dest: '<%= paths.sass %>'
78 }]
79 }
80 },
81 sass: {
82 options: {
83 outputStyle: 'expanded',
84 precision: 8,
85 includePaths: [
86 'node_modules/bootstrap-sass/assets/stylesheets',
87 'node_modules/font-awesome/scss',
88 'node_modules/eonasdan-bootstrap-datetimepicker/src/sass',
89 'node_modules/tagsort'
90 ]
91 },
92 backend: {
93 files: {
94 "<%= paths.backend %>Public/Css/backend.css": "<%= paths.sass %>backend.scss"
95 }
96 },
97 core: {
98 files: {
99 "<%= paths.core %>Public/Css/errorpage.css": "<%= paths.sass %>errorpage.scss"
100 }
101 },
102 form: {
103 files: {
104 "<%= paths.form %>Public/Css/form.css": "<%= paths.sass %>form.scss"
105 }
106 },
107 frontend: {
108 files: {
109 "<%= paths.frontend %>Public/Css/adminpanel.css": "<%= paths.sass %>adminpanel.scss"
110 }
111 },
112 install: {
113 files: {
114 "<%= paths.install %>Public/Css/install.css": "<%= paths.sass %>install.scss"
115 }
116 },
117 linkvalidator: {
118 files: {
119 "<%= paths.linkvalidator %>Public/Css/linkvalidator.css": "<%= paths.sass %>linkvalidator.scss"
120 }
121 },
122 workspaces: {
123 files: {
124 "<%= paths.workspaces %>Public/Css/preview.css": "<%= paths.sass %>workspace.scss"
125 }
126 },
127 t3editor: {
128 files: {
129 '<%= paths.t3editor %>Public/Css/t3editor.css': '<%= paths.sass %>editor.scss'
130 }
131 }
132 },
133 postcss: {
134 options: {
135 map: false,
136 processors: [
137 require('autoprefixer')({
138 browsers: [
139 'Chrome >= 57',
140 'Firefox >= 52',
141 'Edge >= 14',
142 'Explorer >= 11',
143 'iOS >= 9',
144 'Safari >= 8',
145 'Android >= 4',
146 'Opera >= 43'
147 ]
148 }),
149 require('postcss-clean')({
150 rebase: false,
151 level: {
152 1: {
153 specialComments: 0
154 }
155 }
156 }),
157 require('postcss-banner')({
158 banner: 'This file is part of the TYPO3 CMS project.\n' +
159 '\n' +
160 'It is free software; you can redistribute it and/or modify it under\n' +
161 'the terms of the GNU General Public License, either version 2\n' +
162 'of the License, or any later version.\n' +
163 '\n' +
164 'For the full copyright and license information, please read the\n' +
165 'LICENSE.txt file that was distributed with this source code.\n' +
166 '\n' +
167 'The TYPO3 project - inspiring people to share!',
168 important: true,
169 inline: false
170 })
171 ]
172 },
173 backend: {
174 src: '<%= paths.backend %>Public/Css/*.css'
175 },
176 core: {
177 src: '<%= paths.core %>Public/Css/*.css'
178 },
179 form: {
180 src: '<%= paths.form %>Public/Css/*.css'
181 },
182 frontend: {
183 src: '<%= paths.frontend %>Public/Css/*.css'
184 },
185 install: {
186 src: '<%= paths.install %>Public/Css/*.css'
187 },
188 linkvalidator: {
189 src: '<%= paths.linkvalidator %>Public/Css/*.css'
190 },
191 t3editor: {
192 src: '<%= paths.t3editor %>Public/Css/**/*.css'
193 },
194 workspaces: {
195 src: '<%= paths.workspaces %>Public/Css/*.css'
196 }
197 },
198 exec: {
199 ts: ((process.platform === 'win32') ? 'node_modules\\.bin\\tsc.cmd' : './node_modules/.bin/tsc') + ' --project tsconfig.json',
200 'yarn-install': 'yarn install'
201 },
202 tslint: {
203 options: {
204 configuration: 'tslint.json',
205 force: false
206 },
207 files: {
208 src: [
209 '<%= paths.sysext %>*/Tests/TypeScript/**/*.ts',
210 '<%= paths.sysext %>*/Resources/Private/TypeScript/**/*.ts',
211 './types/**/*.ts'
212 ]
213 }
214 },
215 watch: {
216 options: {
217 livereload: true
218 },
219 sass: {
220 files: '<%= paths.sass %>**/*.scss',
221 tasks: 'css'
222 },
223 ts: {
224 files: '<%= paths.sysext %>*/**/TypeScript/**/*.ts',
225 tasks: 'scripts'
226 }
227 },
228 copy: {
229 options: {
230 punctuation: ''
231 },
232 ts_files: {
233 files: [{
234 expand: true,
235 cwd: '<%= paths.root %>Build/JavaScript/typo3/sysext/',
236 src: ['**/*.js', '**/*.js.map'],
237 dest: '<%= paths.sysext %>',
238 rename: function (dest, src) {
239 var srccleaned = src.replace('Resources/Private/TypeScript', 'Resources/Public/JavaScript');
240 srccleaned = srccleaned.replace('Tests/TypeScript', 'Tests/JavaScript');
241 return dest + srccleaned;
242 }
243 }]
244 },
245 core_icons: {
246 files: [{
247 expand: true,
248 cwd: '<%= paths.t3icons %>',
249 src: ['**/*.svg', '!module/*'],
250 dest: '<%= paths.sysext %>core/Resources/Public/Icons/T3Icons/',
251 ext: '.svg'
252 }]
253 },
254 module_icons: {
255 files: [
256 {
257 dest: '<%= paths.sysext %>about/Resources/Public/Icons/module-about.svg',
258 src: '<%= paths.t3icons %>module/module-about.svg'
259 },
260 {
261 dest: '<%= paths.sysext %>belog/Resources/Public/Icons/module-belog.svg',
262 src: '<%= paths.t3icons %>module/module-belog.svg'
263 },
264 {
265 dest: '<%= paths.sysext %>beuser/Resources/Public/Icons/module-beuser.svg',
266 src: '<%= paths.t3icons %>module/module-beuser.svg'
267 },
268 {
269 dest: '<%= paths.sysext %>lowlevel/Resources/Public/Icons/module-config.svg',
270 src: '<%= paths.t3icons %>module/module-config.svg'
271 },
272 {
273 dest: '<%= paths.sysext %>documentation/Resources/Public/Icons/module-cshmanual.svg',
274 src: '<%= paths.t3icons %>module/module-cshmanual.svg'
275 },
276 {
277 dest: '<%= paths.sysext %>lowlevel/Resources/Public/Icons/module-dbint.svg',
278 src: '<%= paths.t3icons %>module/module-dbint.svg'
279 },
280 {
281 dest: '<%= paths.sysext %>documentation/Resources/Public/Icons/module-documentation.svg',
282 src: '<%= paths.t3icons %>module/module-documentation.svg'
283 },
284 {
285 dest: '<%= paths.sysext %>extensionmanager/Resources/Public/Icons/module-extensionmanager.svg',
286 src: '<%= paths.t3icons %>module/module-extensionmanager.svg'
287 },
288 {
289 dest: '<%= paths.sysext %>filelist/Resources/Public/Icons/module-filelist.svg',
290 src: '<%= paths.t3icons %>module/module-filelist.svg'
291 },
292 {
293 dest: '<%= paths.sysext %>form/Resources/Public/Icons/module-form.svg',
294 src: '<%= paths.t3icons %>module/module-form.svg'
295 },
296 {
297 dest: '<%= paths.sysext %>indexed_search/Resources/Public/Icons/module-indexed_search.svg',
298 src: '<%= paths.t3icons %>module/module-indexed_search.svg'
299 },
300 {
301 dest: '<%= paths.sysext %>info/Resources/Public/Icons/module-info.svg',
302 src: '<%= paths.t3icons %>module/module-info.svg'
303 },
304 {
305 dest: '<%= paths.sysext %>install/Resources/Public/Icons/module-install.svg',
306 src: '<%= paths.t3icons %>module/module-install.svg'
307 },
308 {
309 dest: '<%= paths.sysext %>lang/Resources/Public/Icons/module-lang.svg',
310 src: '<%= paths.t3icons %>module/module-lang.svg'
311 },
312 {
313 dest: '<%= paths.sysext %>recordlist/Resources/Public/Icons/module-list.svg',
314 src: '<%= paths.t3icons %>module/module-list.svg'
315 },
316 {
317 dest: '<%= paths.sysext %>backend/Resources/Public/Icons/module-page.svg',
318 src: '<%= paths.t3icons %>module/module-page.svg'
319 },
320 {
321 dest: '<%= paths.sysext %>beuser/Resources/Public/Icons/module-permission.svg',
322 src: '<%= paths.t3icons %>module/module-permission.svg'
323 },
324 {
325 dest: '<%= paths.sysext %>recycler/Resources/Public/Icons/module-recycler.svg',
326 src: '<%= paths.t3icons %>module/module-recycler.svg'
327 },
328 {
329 dest: '<%= paths.sysext %>reports/Resources/Public/Icons/module-reports.svg',
330 src: '<%= paths.t3icons %>module/module-reports.svg'
331 },
332 {
333 dest: '<%= paths.sysext %>scheduler/Resources/Public/Icons/module-scheduler.svg',
334 src: '<%= paths.t3icons %>module/module-scheduler.svg'
335 },
336 {
337 dest: '<%= paths.sysext %>setup/Resources/Public/Icons/module-setup.svg',
338 src: '<%= paths.t3icons %>module/module-setup.svg'
339 },
340 {
341 dest: '<%= paths.sysext %>taskcenter/Resources/Public/Icons/module-taskcenter.svg',
342 src: '<%= paths.t3icons %>module/module-taskcenter.svg'
343 },
344 {
345 dest: '<%= paths.sysext %>tstemplate/Resources/Public/Icons/module-tstemplate.svg',
346 src: '<%= paths.t3icons %>module/module-tstemplate.svg'
347 },
348 {
349 dest: '<%= paths.sysext %>viewpage/Resources/Public/Icons/module-viewpage.svg',
350 src: '<%= paths.t3icons %>module/module-viewpage.svg'
351 },
352 {
353 dest: '<%= paths.sysext %>workspaces/Resources/Public/Icons/module-workspaces.svg',
354 src: '<%= paths.t3icons %>module/module-workspaces.svg'
355 }
356 ]
357 },
358 extension_icons: {
359 files: [
360 {
361 dest: '<%= paths.sysext %>form/Resources/Public/Icons/Extension.svg',
362 src: '<%= paths.t3icons %>module/module-form.svg'
363 }
364 ]
365 },
366 fonts: {
367 files: [
368 {
369 expand: true,
370 cwd: '<%= paths.node_modules %>npm-font-source-sans-pro/fonts',
371 src: ['**/*'],
372 dest: '<%= paths.sysext %>backend/Resources/Public/Fonts/SourceSansPro'
373 },
374 {
375 expand: true,
376 cwd: '<%= paths.node_modules %>font-awesome/fonts',
377 src: ['**/*', '!FontAwesome.otf'],
378 dest: '<%= paths.sysext %>backend/Resources/Public/Fonts/FontAwesome'
379 }
380 ]
381 },
382 t3editor: {
383 files: [
384 {
385 expand: true,
386 cwd: '<%= paths.node_modules %>codemirror',
387 dest: '<%= paths.t3editor %>Public/JavaScript/Contrib/cm',
388 src: ['**/*', '!**/src/**', '!rollup.config.js']
389 }
390 ]
391 }
392 },
393 npmcopy: {
394 options: {
395 clean: false,
396 report: false,
397 srcPrefix: "node_modules/"
398 },
399 ckeditor: {
400 options: {
401 destPrefix: "<%= paths.ckeditor %>Public/JavaScript/Contrib"
402 },
403 files: {
404 'ckeditor.js': 'ckeditor/ckeditor.js',
405 'plugins/': 'ckeditor/plugins/',
406 'skins/': 'ckeditor/skins/',
407 'lang/': 'ckeditor/lang/'
408 }
409 },
410 all: {
411 options: {
412 destPrefix: "<%= paths.core %>Public/JavaScript/Contrib"
413 },
414 files: {
415 'nprogress.js': 'nprogress/nprogress.js',
416 'jquery.dataTables.js': 'datatables/media/js/jquery.dataTables.min.js',
417 'require.js': 'requirejs/require.js',
418 'moment.js': 'moment/min/moment-with-locales.min.js',
419 'moment-timezone.js': 'moment-timezone/builds/moment-timezone-with-data.min.js',
420 'cropper.min.js': 'cropper/dist/cropper.min.js',
421 'imagesloaded.pkgd.min.js': 'imagesloaded/imagesloaded.pkgd.min.js',
422 'bootstrap-datetimepicker.js': 'eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
423 'autosize.js': 'autosize/dist/autosize.min.js',
424 'taboverride.min.js': 'taboverride/build/output/taboverride.min.js',
425 'bootstrap-slider.min.js': 'bootstrap-slider/dist/bootstrap-slider.min.js',
426 /* disabled until events are not bound to document only
427 see https://github.com/claviska/jquery-minicolors/issues/192
428 see https://github.com/claviska/jquery-minicolors/issues/206
429 'jquery.minicolors.js': '../node_modules/@claviska/jquery-minicolors/jquery.minicolors.min.js',
430 '../../Images/colorpicker/jquery.minicolors.png': '../node_modules/@claviska/jquery-minicolors/jquery.minicolors.png'
431 */
432 /* disabled until autocomplete formatGroup is fixed to pass on the index too
433 'jquery.autocomplete.js': '../node_modules/devbridge-autocomplete/dist/jquery.autocomplete.min.js',
434 */
435 'd3/d3.js': 'd3/build/d3.min.js',
436 /**
437 * copy needed parts of jquery
438 */
439 'jquery/jquery-3.2.1.js': 'jquery/dist/jquery.js',
440 'jquery/jquery-3.2.1.min.js': 'jquery/dist/jquery.min.js',
441 /**
442 * copy needed parts of jquery-ui
443 */
444 'jquery-ui/core.js': 'jquery-ui/ui/core.js',
445 'jquery-ui/draggable.js': 'jquery-ui/ui/draggable.js',
446 'jquery-ui/droppable.js': 'jquery-ui/ui/droppable.js',
447 'jquery-ui/mouse.js': 'jquery-ui/ui/mouse.js',
448 'jquery-ui/position.js': 'jquery-ui/ui/position.js',
449 'jquery-ui/resizable.js': 'jquery-ui/ui/resizable.js',
450 'jquery-ui/selectable.js': 'jquery-ui/ui/selectable.js',
451 // jquery-ui/sortable.js requires a patch @see: https://github.com/jquery/jquery-ui/pull/1093
452 // for this reason this lib is modified and can't be copied
453 // For the moment this is ok, because we stuck on version 1.11.4 which is very old
454 // the jquery ui stuff should be replaced by modern libs asap
455 // 'jquery-ui/sortable.js': 'jquery-ui/ui/sortable.js',
456 'jquery-ui/widget.js': 'jquery-ui/ui/widget.js'
457 }
458 }
459 },
460 uglify: {
461 thirdparty: {
462 files: {
463 "<%= paths.core %>Public/JavaScript/Contrib/require.js": ["<%= paths.core %>Public/JavaScript/Contrib/require.js"],
464 "<%= paths.core %>Public/JavaScript/Contrib/nprogress.js": ["<%= paths.core %>Public/JavaScript/Contrib/nprogress.js"],
465 "<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/core.js": ["<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/core.js"],
466 "<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/draggable.js": ["<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/draggable.js"],
467 "<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/droppable.js": ["<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/droppable.js"],
468 "<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/mouse.js": ["<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/mouse.js"],
469 "<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/position.js": ["<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/position.js"],
470 "<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/resizable.js": ["<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/resizable.js"],
471 "<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/selectable.js": ["<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/selectable.js"],
472 "<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/widget.js": ["<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/widget.js"],
473 "<%= paths.install %>Public/JavaScript/chosen.jquery.min.js": ["<%= paths.node_modules %>chosen-js/chosen.jquery.js"],
474 "<%= paths.core %>Public/JavaScript/Contrib/bootstrap-datetimepicker.js": ["<%= paths.core %>Public/JavaScript/Contrib/bootstrap-datetimepicker.js"]
475 }
476 },
477 t3editor: {
478 files: [
479 {
480 expand: true,
481 src: [
482 '<%= paths.t3editor %>Public/JavaScript/Contrib/cm/**/*.js',
483 '!<%= paths.t3editor %>Public/JavaScript/Contrib/cm/**/*.min.js'
484 ],
485 dest: '<%= paths.t3editor %>Public/JavaScript/Contrib/cm',
486 cwd: '.',
487 rename: function (dest, src) {
488 return src;
489 }
490 }
491 ]
492 }
493 }
494 });
495
496 // Register tasks
497 grunt.loadNpmTasks('grunt-sass');
498 grunt.loadNpmTasks('grunt-contrib-watch');
499 grunt.loadNpmTasks('grunt-npmcopy');
500 grunt.loadNpmTasks('grunt-contrib-uglify');
501 grunt.loadNpmTasks('grunt-postcss');
502 grunt.loadNpmTasks('grunt-contrib-copy');
503 grunt.loadNpmTasks('grunt-exec');
504 grunt.loadNpmTasks('grunt-tslint');
505 grunt.loadNpmTasks('grunt-stylelint');
506
507 /**
508 * grunt default task
509 *
510 * call "$ grunt"
511 *
512 * this will trigger the CSS build
513 */
514 grunt.registerTask('default', ['css']);
515
516 /**
517 * grunt lint
518 *
519 * call "$ grunt lint"
520 *
521 * this task does the following things:
522 * - tslint
523 * - stylelint
524 */
525 grunt.registerTask('lint', ['tslint', 'stylelint']);
526
527 /**
528 * grunt format
529 *
530 * call "$ grunt format"
531 *
532 * this task does the following things:
533 * - formatsass
534 * - lint
535 */
536 grunt.registerTask('format', ['formatsass', 'stylelint']);
537
538 /**
539 * grunt css task
540 *
541 * call "$ grunt css"
542 *
543 * this task does the following things:
544 * - formatsass
545 * - sass
546 * - postcss
547 */
548 grunt.registerTask('css', ['formatsass', 'sass', 'postcss']);
549
550 /**
551 * grunt update task
552 *
553 * call "$ grunt update"
554 *
555 * this task does the following things:
556 * - yarn install
557 * - copy some components to a specific destinations because they need to be included via PHP
558 */
559 grunt.registerTask('update', ['exec:yarn-install', 'npmcopy']);
560
561 /**
562 * grunt scripts task
563 *
564 * call "$ grunt scripts"
565 *
566 * this task does the following things:
567 * - 1) Check all TypeScript files (*.ts) with TSLint which are located in sysext/<EXTKEY>/Resources/Private/TypeScript/*.ts
568 * - 2) Compiles all TypeScript files (*.ts) which are located in sysext/<EXTKEY>/Resources/Private/TypeScript/*.ts
569 * - 3) Copy all generated JavaScript and Map files to public folders
570 */
571 grunt.registerTask('scripts', ['tsconfig', 'tslint', 'tsclean', 'exec:ts', 'copy:ts_files']);
572
573 /**
574 * grunt tsclean task
575 *
576 * call "$ grunt tsclean"
577 *
578 * Clean the JavaScript output folder before building
579 */
580 grunt.task.registerTask('tsclean', function () {
581 grunt.option('force');
582 grunt.file.delete("JavaScript");
583 });
584
585 /**
586 * grunt tsdev task
587 *
588 * call "$ grunt tsdev"
589 *
590 * this task copies and modifies the TypeScript configuration for a developer system
591 * most TypeScript tooling expects tsconfig.json to be in a domineering/root-level position
592 */
593 grunt.task.registerTask('tsdev', function () {
594 var content = grunt.file.read("tsconfig.json");
595 content = content.replace(/..\/typo3\//g, 'typo3/');
596 content = content.replace('"rootDir": "../",', '"rootDir": "./",');
597 content = content.replace('./JavaScript', './Build/JavaScript');
598 content = content.replace('"node_modules/@types"', '"Build/node_modules/@types"');
599 content = content.replace('"types"', '"Build/types"');
600 grunt.file.write('../tsconfig.json', content);
601 grunt.file.copy('./tslint.json', '../tslint.json');
602 });
603
604 /**
605 * grunt tsconfig task
606 *
607 * call "$ grunt tsconfig"
608 *
609 * this task updates the tsconfig.json file with modules paths for all sysexts
610 */
611 grunt.task.registerTask('tsconfig', function () {
612 var config = grunt.file.readJSON("tsconfig.json");
613 config.compilerOptions.paths = {};
614 grunt.file.expand('../typo3/sysext/*/Resources/Public/JavaScript').forEach(function (dir) {
615 var extname = '_' + dir.match(/sysext\/(.*?)\//)[1],
616 extname = extname.replace(/_./g, function (match) {
617 return match.charAt(1).toUpperCase();
618 });
619 var namespace = 'TYPO3/CMS/' + extname + '/*',
620 path = dir + "/*",
621 typescriptPath = path.replace('Public/JavaScript', 'Private/TypeScript');
622 config.compilerOptions.paths[namespace] = [path, typescriptPath];
623 });
624
625 grunt.file.write('tsconfig.json', JSON.stringify(config, null, 4));
626 });
627
628 /**
629 * grunt build task
630 *
631 * call "$ grunt build"
632 *
633 * this task does the following things:
634 * - execute update task
635 * - execute copy task
636 * - compile sass files
637 * - uglify js files
638 * - minifies svg files
639 * - compiles TypeScript files
640 */
641 grunt.registerTask('build', ['update', 'scripts', 'copy', 'format', 'css', 'uglify']);
642 };