This repository has been archived by the owner on Dec 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
46 lines (43 loc) · 1.55 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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-jasmine');
var requirePaths = {
'template_engine': 'empty:',
'ShareTools': 'ShareToolsController',
'text': '../node_modules/requirejs-text/text'
};
var jasminePaths = JSON.parse(JSON.stringify(requirePaths)); // quick dirty object clone
jasminePaths['template_engine'] = '../node_modules/template_engine/template_engine';
grunt.initConfig({
jasmine: {
all: {
src: 'src/*.js',
options: {
specs: 'tests/*[sS]pec.js',
template: require('grunt-template-jasmine-requirejs'),
templateOptions: {
requireConfig: {
baseUrl: './src',
paths: jasminePaths
}
}
}
}
},
requirejs: {
compile: {
options: {
// optimize: 'none', // useful for debugging
baseUrl: './src',
name: 'ShareTools',
out: './bin/sharetools.min.js',
paths: requirePaths,
preserveLicenseComments: false,
stubModules : ['text'],
normalizeDirDefines: true
}
}
}
});
grunt.registerTask('default', ['requirejs', 'jasmine:all']);
};