Skip to content

Commit

Permalink
Reproduce Issue 25484 nextjs vercel/next.js#25484
Browse files Browse the repository at this point in the history
  • Loading branch information
Qeldrona committed Jun 21, 2021
1 parent 8db5fb8 commit c307148
Show file tree
Hide file tree
Showing 8 changed files with 1,814 additions and 1,048 deletions.
7 changes: 7 additions & 0 deletions deep.thought.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { guid } from "@/scripts/util";

self.onmessage = ({ data: { question } }) => {
self.postMessage({
answer: guid(),
});
};
18 changes: 18 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/src/*": ["src/*"],
"@/components/*": ["src/components/*"],
"@/functions/*": ["src/components/functions/*"],
"@/services/*": ["src/components/services/*"],
"@/workers/*": ["src/components/workers/*"],
"@/context/*": ["src/context/*"],
"@/data/*": ["src/data/*"],
"@/scripts/*": ["src/scripts/*"],
"@/store/*": ["store/*"],
"@/__mocks__/*": ["__mocks__/*"],
"@/pages/*": ["pages/*"]
}
}
}
42 changes: 42 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const nextConfig = {
serverRuntimeConfig: {
// Will only be available on the server side
mySecret: 'secret',
secondSecret: process.env.SECOND_SECRET, // Pass through env variables
},
publicRuntimeConfig: {
// Will be available on both server and client
staticFolder: '/static',
butthead: true
},
webpack: (config, options) => {
config.optimization.splitChunks = {
chunks: (chunk) => !/^(polyfills|main|pages\/_app)$/.test(chunk.name),
minSize: 20000,
minRemainingSize: 0,
minChunks: 1,
maxAsyncRequests: 30,
maxInitialRequests: 25,
enforceSizeThreshold: 50000,
cacheGroups: {
defaultVendors: false,
default: false,
framework: {
chunks: 'all',
name: 'framework',
test: /(?<!node_modules.*)[\\/]node_modules[\\/](react|react-dom|scheduler|prop-types|use-subscription)[\\/]/,
priority: 40,
enforce: true,
},
commons: {
name: 'commons',
minChunks: 1,
priority: 20,
},
},
}
return config;
},
};

module.exports = nextConfig;
Loading

0 comments on commit c307148

Please sign in to comment.