This repository has been archived by the owner on Sep 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.js
60 lines (53 loc) · 1.59 KB
/
Gruntfile.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var webpack = require('webpack');
var webpackConfig = require('./webpack.config.js');
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
ngtemplates: {
core: {
src: 'app/**/*.html',
dest: 'app/templates-cache.generated.js',
options: {
htmlmin: {
collapseWhitespace: true,
collapseBooleanAttributes: true
},
bootstrap: function (module, script) {
return '"use strict";' +
'angular.module("livesite-management.templates-cache")' +
'.run([\'$templateCache\', function($templateCache) {' +
script + ' }]);';
}
}
},
dev: {
dest: 'app/templates-cache.generated.js',
src: [],
options: {bootstrap: () => ''}
}
},
clean: {
options: {force: true},
structure: ['dist']
},
webpack: {
options: webpackConfig,
build: {}
},
'webpack-dev-server': {
start: {
webpack: webpackConfig
}
}
});
grunt.registerTask('build', [
'clean',
'ngtemplates:core',
'webpack:build'
]);
grunt.registerTask('server', [
'clean',
'ngtemplates:dev',
'webpack-dev-server:start'
]);
};