-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
build: generate multiple formats (cjs, esm) #8736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
"allowJs": true, | ||
"outDir": "dist", | ||
"lib": ["es7"], | ||
"esModuleInterop": true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the reason for setting this to true? Is it necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It pretty well explained https://stackoverflow.com/a/56348146/3130446 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, so because this will allow us to start letting Nest be used via ESM we need to make the rest of the CJS imports ESM compatible, correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, it just adds the compatibility |
||
"paths": { | ||
"@nestjs/common": ["./packages/common"], | ||
"@nestjs/common/*": ["./packages/common/*"], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { defineConfig } from 'tsup'; | ||
|
||
export default defineConfig({ | ||
splitting: false, | ||
sourcemap: true, | ||
outDir: 'node_modules/@nestjs', | ||
clean: true, | ||
entryPoints: [ | ||
'packages/common/index.ts', | ||
'packages/core/index.ts', | ||
'packages/microservices/index.ts', | ||
'packages/platform-express/index.ts', | ||
'packages/platform-fastify/index.ts', | ||
'packages/platform-socket.io/index.ts', | ||
'packages/platform-ws/index.ts', | ||
'packages/testing/index.ts', | ||
'packages/websockets/index.ts' | ||
], | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all the
@ts-ignore
s? Is there a typing that isn't right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TS was complaining the typing isn't right!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we should probably fix it rather than ignore it, right?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, but I just didn't want to break anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ts-ignore = I know it may break things but I do accept it.