Skip to content

Commit 14d4639

Browse files
author
Paul Cuthbertson
committed
Wraps grunt-starlight output in a function in order to not pollute the global JS namespace.
1 parent 2b4049e commit 14d4639

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/build-tools/grunt/tasks/starlight.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ module.exports = function(grunt) {
6868
var start = "require'" + mainFilename + "'\n";
6969
var ast = parser.parse(src + start);
7070
var js = generateJS(ast);
71+
var runtimeInit = getRuntimeInit();
72+
js = ';(()=>{' + runtimeInit + js + '})();';
7173

7274
// Write the destination file.
73-
var runtimeInit = getRuntimeInit();
74-
grunt.file.write(f.dest, runtimeInit + js);
75+
grunt.file.write(f.dest, js);
7576

7677
// Print a success message.
7778
grunt.log.writeln('File "' + f.dest + '" created.');

0 commit comments

Comments
 (0)