-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Next.js] Next 13 upgrade * Add comment * Update yarn.lock * Provide Image 'alt' as an empty string * Add changes according to review comments
- Loading branch information
1 parent
80218f6
commit f6f0f68
Showing
21 changed files
with
304 additions
and
202 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
13 changes: 2 additions & 11 deletions
13
packages/create-sitecore-jss/src/templates/nextjs/src/lib/next-config/plugins/monorepo.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,21 @@ | ||
const withTM = require('next-transpile-modules')(['@sitecore-jss/sitecore-jss-nextjs'], { | ||
resolveSymlinks: false, | ||
}); | ||
const path = require('path'); | ||
|
||
const CWD = process.cwd(); | ||
|
||
/** | ||
* @param {import('next').NextConfig} nextConfig | ||
*/ | ||
const monorepoPlugin = (nextConfig = {}) => { | ||
return withTM(Object.assign({}, nextConfig, { | ||
return Object.assign({}, nextConfig, { | ||
webpack: (config, options) => { | ||
if (options.isServer) { | ||
config.externals = ['react', 'vertx', ...config.externals]; | ||
} | ||
|
||
config.resolve.alias['react'] = path.resolve(CWD, '.', 'node_modules', 'react'); | ||
|
||
// Overload the Webpack config if it was already overloaded | ||
if (typeof nextConfig.webpack === 'function') { | ||
return nextConfig.webpack(config, options); | ||
} | ||
|
||
return config; | ||
} | ||
})); | ||
}); | ||
}; | ||
|
||
module.exports = monorepoPlugin; |
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
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
Oops, something went wrong.