francescov1 / mongoose-tsgen

A plug-n-play Typescript generator for Mongoose.
103 stars 24 forks source link

Ignore a file in the directory #50

Closed shahidcodes closed 3 years ago

shahidcodes commented 3 years ago

How can I ignore a file in the models folder. I've some imports in models/index.ts which is causing a generation to fail.

francescov1 commented 3 years ago

Hey @shahidcodes,

What does your folder structure look like and how are you running the generator? There is not currently an explicit option to ignore certain paths (although its in the roadmap) but there are other ways you can achieve this, just need to better understand your use case.

shahidcodes commented 3 years ago

I was able to solve the problem using -i (--import) and changing the import from

import Bootstrap from '@/backend/bootstrap'

To

import Bootstrap from '../../backend/bootstrap'

Also my folder structure is like below

/models
    /index.ts - re exports all the models in the folder, with some login to connect to dB 
    /user.ts - model file
francescov1 commented 3 years ago

Awesome, great to hear!