The project uses the following file structure:

|--modules |----module1 |------module1.pug |------module1.json |----module2 |------module2.pug |------module2.json 

Then all modules are connected to index.pug

 |--pages |----index.pug 

And in gulpfile , all pug files are compiled into html , and added to the dist directory

 gulp.task("html", function() { return gulp.src("src/pages/*.pug") .pipe(plumber()) .pipe(pug()) .pipe(gulp.dest("dist")) }); 

Everything is standard, simple, without a sophisticated code. But now how can I make the file module1.json connect to the file module1.pug , module2.json to module2.pug , and so on. In one lesson on YouTube, in one article in Google, I could not find how to implement it. Is reading data from json so unclaimed and unpopular? I hope to help me here.

    0