Skip to content

Commit ccfa0f9

Browse files
committed
Watch only files with API documentation
1 parent 5713535 commit ccfa0f9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

bin/swagger-jsdoc.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ var input = process.argv.slice(2);
1818
// The spec, following a convention.
1919
var output = 'swagger.json';
2020

21-
// No-cache module loading.
22-
function requireNoCache(module) {
23-
delete require.cache[require.resolve(module)];
24-
return require(module);
25-
}
26-
2721
/**
2822
* Creates a swagger specification from a definition and a set of files.
2923
* @function
@@ -93,7 +87,7 @@ fs.readFile(program.definition, 'utf-8', function(err, data) {
9387
}
9488

9589
// Get an object of the definition file configuration.
96-
var swaggerDefinition = requireNoCache(path.resolve(program.definition));
90+
var swaggerDefinition = require(path.resolve(program.definition));
9791

9892
// Check for info object in the definition.
9993
if (!swaggerDefinition.hasOwnProperty('info')) {
@@ -116,7 +110,7 @@ fs.readFile(program.definition, 'utf-8', function(err, data) {
116110

117111
// If watch flag is turned on, listen for changes.
118112
if (program.watch) {
119-
var watcher = chokidar.watch([program.definition, program.args], {
113+
var watcher = chokidar.watch(program.args, {
120114
awaitWriteFinish: {
121115
stabilityThreshold: 2000,
122116
pollInterval: 100,

0 commit comments

Comments
 (0)