All files / options clean.ts

0% Statements 0/9
0% Branches 0/4
0% Functions 0/3
0% Lines 0/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40                                                                               
export = function (grunt: IGrunt) {
	grunt.loadNpmTasks('grunt-contrib-clean');
 
	return {
		typings: {
			src: [ 'typings/' ]
		},
		dist: {
			src: [ 'dist/umd/*' ],
			filter: function (path: string) {
				return grunt.option('remove-links') ? true : !grunt.file.isLink(path);
			}
		},
		dev: {
			src: [ '<%= devDirectory %>' ]
		},
		src: {
			src: [ '{src,tests}/**/*.js' ],
			filter: function (path: string) {
				// Only clean the .js file if a .js.map file also exists
				const mapPath = path + '.map';
				if (grunt.file.exists(mapPath)) {
					grunt.file.delete(mapPath);
					return true;
				}
				return false;
			}
		},
		coverage: {
			src: [ 'coverage-unmapped.json', 'coverage' ]
		},
		typedoc: {
			src: [ '<%= apiDocDirectory %>', '<%= apiPubDirectory %>' ]
		},
		ghpages: {
			src: [ '<%= apiPubDirectory %>' ]
		}
	};
};