Commit graph

2 commits

Author SHA1 Message Date
JJ Kasper
b00fd37972
Fix invalid source maps from terser-webpack-plugin (#45423)
This fixes a regression in our source map generating which got lost in
the big diff from the `src` folder restructure in
https://github.com/vercel/next.js/pull/44405

These invalid source maps broken plugins that attempted to leverage them
like `@sentry/nextjs` which only attempts in a production environment
15ec85bead/packages/nextjs/src/config/webpack.ts (L586)

For a regression test in a follow-up we will need to investigate a
production test fixture with `@sentry/nextjs` although this requires a
DSN be configured.

This also ensures we setup `unhandledRejection` and `uncaughtException`
listeners during build so that we have proper stack information when
these occur and the process isn't left hanging.

This also moves the `extensionAlias` config from
https://github.com/vercel/next.js/pull/44177 to an experimental config
as it seems to cause conflicts with ESM packages that define `exports`
in their `package.json` which can be considered a breaking change.

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

Fixes: https://github.com/vercel/next.js/issues/45419
x-ref: [slack
thread](https://vercel.slack.com/archives/C03DQ3QFV7C/p1674937545579229)
2023-01-30 17:31:33 -08:00
Lotte
67468f98c4
Add support for tsconfig 'nodenext' | 'node16' (#44177)
## ESM: support module option for tsconfig.json 

- fixes #37525
- fixes #41961

With [TypeScript 4.7 providing ECMAScript Module Support](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#ecmascript-module-support-in-node-js), we can now set this in our tsconfig.json file for the [module](https://www.typescriptlang.org/tsconfig#module) option.

Webpack added "extensionAlias" to solve importing ts files with .js extension -> https://github.com/webpack/enhanced-resolve/pull/351



Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-01-28 16:17:40 +00:00