From 0742f2037296f51b987439e5b326e56082ccff8c Mon Sep 17 00:00:00 2001 From: Jakub Jablonski Date: Wed, 3 May 2023 19:16:11 +0200 Subject: [PATCH] refactor: change next config file to mjs --- next.config.js => next.config.mjs | 11 +++++------ tsconfig.json | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) rename next.config.js => next.config.mjs (59%) diff --git a/next.config.js b/next.config.mjs similarity index 59% rename from next.config.js rename to next.config.mjs index 113fd61..55f6899 100644 --- a/next.config.js +++ b/next.config.mjs @@ -1,13 +1,10 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const withBundleAnalyzer = require("@next/bundle-analyzer")({ - enabled: process.env.ANALYZE === "true", -}) -const withPlugins = require("next-compose-plugins") +import withBundleAnalyzer from "@next/bundle-analyzer" +import withPlugins from "next-compose-plugins" /** * @type {import('next').NextConfig} */ -module.exports = withPlugins([[withBundleAnalyzer]], { +const config = withPlugins([[withBundleAnalyzer({ enabled: process.env.ANALYZE === "true" })]], { reactStrictMode: true, experimental: { instrumentationHook: true }, rewrites() { @@ -19,3 +16,5 @@ module.exports = withPlugins([[withBundleAnalyzer]], { ] }, }) + +export default config diff --git a/tsconfig.json b/tsconfig.json index 5d88d20..32b3fdd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,6 @@ "incremental": true, "baseUrl": "." }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.mjs"], "exclude": ["node_modules"] }