1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 06:18:27 -04:00

fix NextConfig types in next.config.js

This commit is contained in:
Jake Jarvis 2022-02-06 20:44:54 -05:00
parent ee1b708b99
commit 18b2fc7d83
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39

View File

@ -1,17 +1,10 @@
/**
* @type {import('next').NextConfig}
*/
const path = require("path");
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants");
const withPlugins = require("next-compose-plugins");
const config = require("./lib/config");
module.exports = (phase, { defaultConfig }) => {
const IS_DEV_SERVER = phase === PHASE_DEVELOPMENT_SERVER;
return withPlugins(
[
const nextPlugins = [
require("next-transpile-modules")([
// fixes some mystery issues in the noVNC library
"@novnc/novnc",
@ -19,22 +12,22 @@ module.exports = (phase, { defaultConfig }) => {
require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
}),
],
{
];
/**
* @type {import("next").NextConfig}
*/
const nextConfig = {
swcMinify: true,
reactStrictMode: true,
trailingSlash: true,
productionBrowserSourceMaps: true,
env: {
IS_DEV_SERVER,
IS_DEV_SERVER: phase === PHASE_DEVELOPMENT_SERVER,
},
images: {
deviceSizes: [640, 750, 828, 1080, 1200, 1920],
},
experimental: {
optimizeFonts: true,
optimizeImages: true,
},
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/,
@ -50,7 +43,6 @@ module.exports = (phase, { defaultConfig }) => {
use: [
{
loader: "@svgr/webpack",
/** @type {import('@svgr/webpack').LoaderOptions} */
options: {
icon: true,
typescript: true,
@ -115,17 +107,13 @@ module.exports = (phase, { defaultConfig }) => {
destination: "/notes/how-to-shrink-linux-virtual-disk-vmware/",
permanent: true,
},
{
source: "/2018/12/07/shrinking-a-linux-virtual-disk-with-vmware/",
destination: "/notes/how-to-shrink-linux-virtual-disk-vmware/",
permanent: true,
},
{
source: "/2018/12/10/cool-bash-tricks-for-your-terminal-dotfiles/",
destination: "/notes/cool-bash-tricks-for-your-terminal-dotfiles/",
permanent: true,
},
],
}
)(phase, { defaultConfig });
};
return withPlugins(nextPlugins, nextConfig)(phase, { defaultConfig });
};