use next-compose-plugins for simpler config

This commit is contained in:
2022-01-05 08:50:49 -05:00
parent b1687df25b
commit fb491d7337
3 changed files with 128 additions and 129 deletions
+11 -6
View File
@@ -4,12 +4,10 @@
const path = require("path");
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants");
const withPlugins = require("next-compose-plugins");
const config = require("./lib/config");
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
module.exports = (phase) => {
module.exports = (phase, { defaultConfig }) => {
let BASE_URL = ""; // fallback to relative urls
if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") {
// vercel production (set manually)
@@ -22,7 +20,13 @@ module.exports = (phase) => {
BASE_URL = "http://localhost:3000";
}
return withBundleAnalyzer({
return withPlugins(
[
require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
}),
],
{
swcMinify: true,
reactStrictMode: true,
trailingSlash: true,
@@ -136,5 +140,6 @@ module.exports = (phase) => {
permanent: true,
},
],
});
}
)(phase, { defaultConfig });
};
+2 -1
View File
@@ -45,6 +45,7 @@
"markdown-to-jsx": "^7.1.5",
"modern-normalize": "github:sindresorhus/modern-normalize#1fc6b5a86676b7ac8abc62d04d6080f92debc70f",
"next": "v12.0.8-canary.17",
"next-compose-plugins": "^2.2.1",
"next-mdx-remote": "^3.0.8",
"next-seo": "^4.28.1",
"node-fetch": "^3.1.0",
@@ -68,7 +69,7 @@
"devDependencies": {
"@jakejarvis/eslint-config": "github:jakejarvis/eslint-config#main",
"@svgr/webpack": "^6.1.2",
"@types/lodash.groupby": "^4.6.6",
"@types/prop-types": "^15.7.4",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@types/react-is": "^17.0.3",
+6 -13
View File
@@ -1490,18 +1490,6 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
"@types/lodash.groupby@^4.6.6":
version "4.6.6"
resolved "https://registry.yarnpkg.com/@types/lodash.groupby/-/lodash.groupby-4.6.6.tgz#4d9b61a4d8b0d83d384975cabfed4c1769d6792e"
integrity sha512-kwg3T7Ia63KtDNoQQR8hKrLHCAgrH4I44l5uEMuA6JCbj7DiSccaV4tNV1vbjtAOpX990SolVthJCmBVtRVRgw==
dependencies:
"@types/lodash" "*"
"@types/lodash@*":
version "4.14.178"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8"
integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==
"@types/mdast@^3.0.0":
version "3.0.10"
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.10.tgz#4724244a82a4598884cbbe9bcfd73dff927ee8af"
@@ -1534,7 +1522,7 @@
resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109"
integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==
"@types/prop-types@*":
"@types/prop-types@*", "@types/prop-types@^15.7.4":
version "15.7.4"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11"
integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==
@@ -4034,6 +4022,11 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
next-compose-plugins@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/next-compose-plugins/-/next-compose-plugins-2.2.1.tgz#020fc53f275a7e719d62521bef4300fbb6fde5ab"
integrity sha512-OjJ+fV15FXO2uQXQagLD4C0abYErBjyjE0I0FHpOEIB8upw0hg1ldFP6cqHTJBH1cZqy96OeR3u1dJ+Ez2D4Bg==
next-mdx-remote@^3.0.8:
version "3.0.8"
resolved "https://registry.yarnpkg.com/next-mdx-remote/-/next-mdx-remote-3.0.8.tgz#ea2e7f9f3c99a0ce8167976c547e621d5930e1e0"