forked from smart-on-fhir/client-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
46 lines (43 loc) · 1.33 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-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-curl');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.initConfig({
curl: {
conformance: {
dest: 'vendor/conformance.json',
src: 'http://hl7-fhir.github.io/conformance-base.json'
}
},
shell: {
browserify: {
command: "./node_modules/.bin/browserify -e client/entry.js -i 'jsdom' > dist/fhir-client.js",
options: {
failOnError: true,
stderr: true
}
},
'6to5': {
command: "sed -i '' 's/const /var /g' dist/fhir-client.js",
options: {
failOnError: true,
stderr: true
}
}
},
uglify: {
minifiedLib: {
files: {
'dist/fhir-client.min.js': ['dist/fhir-client.js']
}
}
}
});
grunt.registerTask('browserify', 'Browserify to create window.FHIR', ['shell:browserify']);
grunt.registerTask('6to5', 'Transcode ES6 to ES5', ['shell:6to5']);
grunt.registerTask('conformance', 'Download conformance base', ['curl:conformance']);
grunt.registerTask('default', ['browserify', '6to5', 'uglify:minifiedLib']);
grunt.registerTask('all', ['conformance', 'default']);
};