Skip to content

Commit

Permalink
add custom webpack conditionNames for worker, remove custom cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsWendell committed Aug 2, 2022
1 parent fa4ad77 commit 8d6b389
Show file tree
Hide file tree
Showing 6 changed files with 608 additions and 249 deletions.
39 changes: 25 additions & 14 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
compiler: {
emotion: true,
},
experimental: {
runtime: 'experimental-edge',
},
typescript: {
ignoreBuildErrors: true,
module.exports = async (phase, { defaultConfig }) => {
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
reactStrictMode: true,
compiler: {
emotion: true,
},
webpack: (config, ctx) => {
if (ctx.nextRuntime === "edge") {
if (!config.resolve.conditionNames) {
config.resolve.conditionNames = ['require', 'node'];
}
if (!config.resolve.conditionNames.includes("worker")) {
config.resolve.conditionNames.push("worker");
}
}
return config;
},
experimental: {
runtime: 'experimental-edge',
},
}
}

module.exports = nextConfig;
return nextConfig
}
Loading

0 comments on commit 8d6b389

Please sign in to comment.