Git Product home page Git Product logo

Comments (3)

 avatar commented on June 25, 2024 1

So the solution is to require your config file like so
const esdocConfig = require( "./path/to/dir/esdoc.json" );
then:
gulp.src(["./src"]).pipe( esDoc( esdocConfig ) );
Should do it!

from gulp-esdoc.

liu946 avatar liu946 commented on June 25, 2024

I have checked your code and find that config file is 'path/to/dir/esdoc.json'. please use the input string user-defined path instead when config is a STRING.

from gulp-esdoc.

colbin8r avatar colbin8r commented on June 25, 2024

This plugin supports ESDoc config file. The real issue is in the name of the file it looks for: tt should look for .esdoc.json as stated by the docs, but instead looks for a esdoc.json file.

ESDoc automatically finds the configuration file path by the order, if you don't specify -c esdoc.json.

  1. .esdoc.json in the current directory
  2. .esdoc.js in the current directory
  3. esdoc property in package.json

In the meantime, you could do something like this ES6 code, which I myself use:

let esdocConfigPath = path.join(process.cwd(), '.esdoc.json'), data, esdocConfig;
if (fs.existsSync(esdocConfigPath)) {
  data = fs.readFileSync(esdocConfigPath, { encoding: 'utf8' });
  esdocConfig = !data ? {} : JSON.parse(data);
  console.log('Found ESDoc config in .esdoc.json!');
} else {
  esdocConfig  = {};
}

from gulp-esdoc.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.