| 1 | module.exports = function(grunt) { |
| 2 | grunt.initConfig({ |
| 3 | pkg: grunt.file.readJSON('package.json'), |
| 4 | ts: { |
| 5 | tsconfig: './tsconfig.json', |
| 6 | buildWatch: { |
| 7 | watch: './src', |
| 8 | }, |
| 9 | build: {} |
| 10 | }, |
| 11 | mkdir: { |
| 12 | assets: { |
| 13 | options: { |
| 14 | create: ['dist/assets'], |
| 15 | } |
| 16 | } |
| 17 | }, |
| 18 | copy: { |
| 19 | assets: { |
| 20 | files: [{ |
| 21 | expand: true, |
| 22 | cwd: 'src/assets', |
| 23 | src: '**', |
| 24 | dest: 'dist/assets', |
| 25 | }] |
| 26 | }, |
| 27 | }, |
| 28 | clean: { |
| 29 | build: ['dist'], |
| 30 | } |
| 31 | }); |
| 32 | grunt.loadNpmTasks('grunt-contrib-clean'); |
| 33 | grunt.loadNpmTasks('grunt-mkdir'); |
| 34 | grunt.loadNpmTasks('grunt-contrib-copy'); |
| 35 | grunt.loadNpmTasks('grunt-ts'); |
| 36 | grunt.registerTask('default', ['clean:build', 'ts:build', 'mkdir:assets', 'copy:assets']); |
| 37 | }; |