Last active
January 7, 2020 14:37
-
-
Save avaly/6c1a44a3ef4afc49d7206edcd323443d to your computer and use it in GitHub Desktop.
typegoose-es-modules-bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "module", | |
"devDependencies": { | |
"@types/mongoose": "5.5.39", | |
"typescript": "3.7.4" | |
}, | |
"dependencies": { | |
"@typegoose/typegoose": "6.2.0", | |
"mongoose": "5.8.3" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"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