forked from HL7/fhirpath.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
33 lines (28 loc) · 883 Bytes
/
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
module.exports = function (grunt) {
// Load grunt tasks automatically, when needed
require('jit-grunt')(grunt, {
replace: 'grunt-text-replace'
});
// Define the configuration for all the tasks
grunt.initConfig({
replace: {
'antlr4-index': {
src: ['src/parser/generated/*.js'],
overwrite: true,
replacements: [{
from: "import antlr4 from 'antlr4';",
to: "const antlr4 = require('../antlr4-index');"
}, {
from: "import FHIRPathListener from './FHIRPathListener.js';",
to: "const FHIRPathListener = require('./FHIRPathListener');"
}, {
from: /export default class (.*) extends ([\s\S]*)/gm,
to: "class $1 extends $2\nmodule.exports = $1;"
}]
}
}
});
grunt.registerTask('updateParserRequirements', [
'replace:antlr4-index'
]);
};