Skip to content

Instantly share code, notes, and snippets.

@avaly
Last active January 7, 2020 14:37
Show Gist options
  • Save avaly/6c1a44a3ef4afc49d7206edcd323443d to your computer and use it in GitHub Desktop.
Save avaly/6c1a44a3ef4afc49d7206edcd323443d to your computer and use it in GitHub Desktop.
typegoose-es-modules-bug
{
"type": "module",
"devDependencies": {
"@types/mongoose": "5.5.39",
"typescript": "3.7.4"
},
"dependencies": {
"@typegoose/typegoose": "6.2.0",
"mongoose": "5.8.3"
}
}
import { getModelForClass, modelOptions, prop } from '@typegoose/typegoose';
@modelOptions({ schemaOptions: { collection: 'users' } })
export class UserClass {
@prop()
language: string;
@prop()
id: string;
static foo() {
return 'bar';
}
}
export default getModelForClass(UserClass);
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"module": "ESNext",
"moduleResolution": "Node",
"outDir": "./ts",
"target": "ESNext"
},
"include": ["./src"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment