Skip to content

Commit

Permalink
add webpack5 for nextjs v9.5 (#3572)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrenner authored and tlhunter committed Aug 23, 2023
1 parent 09cd9fb commit b72f68b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/datadog-plugin-next/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ describe('Plugin', function () {

delete pkg.workspaces

// builds fail for next.js 9.5 using node 14 due to webpack issues
// note that webpack version cannot be set in v9.5 in next.config.js so we do it here instead
// the link below highlights the initial support for webpack 5 (used to fix this issue) in next.js 9.5
// https://nextjs.org/blog/next-9-5#webpack-5-support-beta
if (realVersion.startsWith('9')) pkg.resolutions = { webpack: '^5.0.0' }

writeFileSync(`${__dirname}/package.json`, JSON.stringify(pkg, null, 2))

// installing here for standalone purposes, copying `nodules` above was not generating the server file properly
Expand Down

0 comments on commit b72f68b

Please sign in to comment.