-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Description
Has anyone had any luck with using swagger-ui with Browserify?
I have an app.js file with the follwing:
var SwaggerUi = require('swagger-ui')
var swaggerUi = new SwaggerUi({
// ... options
})
swaggerUi.load()..and a gulp file with:
gulp.task('js', function () {
return browserify({
entries: ['./path/to/app.js']
})
.bundle()
.pipe(source('app.js'))
.pipe(gulp.dest('path/to/output/folder'))
})Running gulp then results in:
> gulp
[17:39:10] Using gulpfile ~/path/to/gulpfile.js
[17:39:10] Starting 'js'...
events.js:141
throw er; // Unhandled 'error' event
^
Error: Cannot find module './lib/auth' from '/path/to/my/project/node_modules/swagger-ui/dist'
at /path/to/my/project/node_modules/browserify/node_modules/resolve/lib/async.js:55:21
at load (/path/to/my/project/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
at onex (/path/to/my/project/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
at /path/to/my/project/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:82:15)(paths changed to protect the innocent)
It looks like swagger-ui inlines swagger-client which has a bunch of calls to require which try to find a non-existent ./lib/auth file.
Metadata
Metadata
Assignees
Labels
No labels