Wrap all SwaggerUI code in a iife
to avoid leaking globals other than SwaggerUi and swaggerUi TODO: we should remove swaggerUi global dependency too
This commit is contained in:
4
dist/swagger-ui.js
vendored
4
dist/swagger-ui.js
vendored
@@ -4,7 +4,7 @@
|
|||||||
* @link http://swagger.io
|
* @link http://swagger.io
|
||||||
* @license Apache 2.0
|
* @license Apache 2.0
|
||||||
*/
|
*/
|
||||||
'use strict';
|
(function(){'use strict';
|
||||||
|
|
||||||
window.SwaggerUi = Backbone.Router.extend({
|
window.SwaggerUi = Backbone.Router.extend({
|
||||||
|
|
||||||
@@ -2185,4 +2185,4 @@ SwaggerUi.Views.StatusCodeView = Backbone.View.extend({
|
|||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
});
|
});}).call(this);
|
||||||
4
dist/swagger-ui.min.js
vendored
4
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -59,6 +59,7 @@ gulp.task('dist', ['clean'], function() {
|
|||||||
)
|
)
|
||||||
.pipe(order(['scripts.js', 'templates.js']))
|
.pipe(order(['scripts.js', 'templates.js']))
|
||||||
.pipe(concat('swagger-ui.js'))
|
.pipe(concat('swagger-ui.js'))
|
||||||
|
.pipe(wrap('(function(){<%= contents %>}).call(this);'))
|
||||||
.pipe(header(banner, { pkg: pkg } ))
|
.pipe(header(banner, { pkg: pkg } ))
|
||||||
.pipe(gulp.dest('./dist'))
|
.pipe(gulp.dest('./dist'))
|
||||||
.pipe(uglify())
|
.pipe(uglify())
|
||||||
|
|||||||
Reference in New Issue
Block a user