Skip to content

Commit 1d9ca9b

Browse files
committed
fix(build): 'use script' statement wrapped with a function to affect only this function and prevent problems with concatenating scripts that aren't strict
1 parent ab6a271 commit 1d9ca9b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

gulpfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ gulp.task('scripts:tidy', ['scripts:lint', 'scripts:cacheTpls'], function () {
154154
return (src.trim() + '\n').replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
155155
}
156156
}))
157-
.pipe(plugins.concatUtil.header('\'use strict\';\n'))
157+
.pipe(plugins.concatUtil.header('(function(window, document, undefined) {\n\'use strict\';\n'))
158+
.pipe(plugins.concatUtil.footer('\n})(window, document);\n'))
158159
.pipe(gulp.dest(config.dist + '/assets'));
159160
});
160161

0 commit comments

Comments
 (0)