Fix ENOENT, add custom cwd, allow .js files and create tmp file if needed
Fix ENOENT, add custom cwd, allow .js files and create tmp file if needed

BUG: Fix ENOENT error by changing the directory in which the jsdoc command is being applied.

ENH: Let the user decide the directory in which the config file is found by passing the "cwd" property to the options of the constructor.

By using a "cwd" option, the user could decide where "./node_modules/jsdoc" lives and still using the "conf" property to specify the config file. That is:

new JsDocPlugin({
	conf: 'jsdoc/config/jsdoc.conf',
	cwd: './src'
});

Means:
Use the file located at "./src/jsdoc/config/jsdoc.conf".
Use the command located at "./src/node_modules/jsdoc".

ENH: Add support for CJS modules exported from config files. I.e.:
Allow "module.exports = ..." in ".js" files.

ENH: Create a temporary file only when needed and remove it afterwards (let the user decide it by passing "preserveTmpFile" to the options of the constructor).

By default, the temporary file is only created if sources are not being taken from the config file. This file adds the ".tmp" suffix and it's removed by default after the compilation is done.

tfiwm/jsdoc-webpack-plugin