From fa7260d72a0fc7cfef4115ddf7e12e0dfd755167 Mon Sep 17 00:00:00 2001 From: Nafees Nazik <84864519+G3root@users.noreply.github.com> Date: Mon, 6 Mar 2023 18:40:39 +0530 Subject: [PATCH] feat: use next transpile packages feature (#7527) * feat: use next transpile packages feature * Also remove next-transpile-modules from storybook (+ remove experimental) --------- Co-authored-by: Alex van Andel --- apps/storybook/next.config.js | 29 +++++++++++++---------------- apps/web/next.config.js | 29 ++++++++++++++--------------- apps/web/package.json | 1 - 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/apps/storybook/next.config.js b/apps/storybook/next.config.js index 605a550c9b..f6b416d05e 100644 --- a/apps/storybook/next.config.js +++ b/apps/storybook/next.config.js @@ -1,21 +1,7 @@ const withBundleAnalyzer = require("@next/bundle-analyzer"); -const withTM = require("next-transpile-modules")([ - "@calcom/app-store", - "@calcom/dayjs", - "@calcom/emails", - "@calcom/trpc", - "@calcom/embed-core", - "@calcom/embed-react", - "@calcom/features", - "@calcom/lib", - "@calcom/prisma", - "@calcom/ui", -]); -const glob = require("glob"); - const plugins = []; -plugins.push(withTM, withBundleAnalyzer({ enabled: process.env.ANALYZE === "true" })); +plugins.push(withBundleAnalyzer({ enabled: process.env.ANALYZE === "true" })); /** @type {import("next").NextConfig} */ const nextConfig = { @@ -27,7 +13,18 @@ const nextConfig = { typescript: { ignoreBuildErrors: true, }, - experimental: { images: { allowFutureImage: true } }, + transpilePackages: [ + "@calcom/app-store", + "@calcom/dayjs", + "@calcom/emails", + "@calcom/trpc", + "@calcom/embed-core", + "@calcom/embed-react", + "@calcom/features", + "@calcom/lib", + "@calcom/prisma", + "@calcom/ui", + ], eslint: { ignoreDuringBuilds: true, }, diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 5138b31987..80079fe424 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -2,20 +2,6 @@ require("dotenv").config({ path: "../../.env" }); const CopyWebpackPlugin = require("copy-webpack-plugin"); const { withSentryConfig } = require("@sentry/nextjs"); const os = require("os"); -const withTM = require("next-transpile-modules")([ - "@calcom/app-store", - "@calcom/core", - "@calcom/dayjs", - "@calcom/emails", - "@calcom/embed-core", - "@calcom/embed-react", - "@calcom/embed-snippet", - "@calcom/features", - "@calcom/lib", - "@calcom/prisma", - "@calcom/trpc", - "@calcom/ui", -]); const { withAxiom } = require("next-axiom"); const { i18n } = require("./next-i18next.config"); @@ -80,7 +66,6 @@ if (process.env.ANALYZE === "true") { plugins.push(withBundleAnalyzer); } -plugins.push(withTM); plugins.push(withAxiom); /** @type {import("next").NextConfig} */ const nextConfig = { @@ -94,6 +79,20 @@ const nextConfig = { eslint: { ignoreDuringBuilds: !!process.env.CI, }, + transpilePackages: [ + "@calcom/app-store", + "@calcom/core", + "@calcom/dayjs", + "@calcom/emails", + "@calcom/embed-core", + "@calcom/embed-react", + "@calcom/embed-snippet", + "@calcom/features", + "@calcom/lib", + "@calcom/prisma", + "@calcom/trpc", + "@calcom/ui", + ], modularizeImports: { "@calcom/ui/components/icon": { transform: "@react-icons/all-files/fi/{{member}}", diff --git a/apps/web/package.json b/apps/web/package.json index 58575af282..41e59c73a2 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -92,7 +92,6 @@ "next-i18next": "^11.3.0", "next-seo": "^4.26.0", "next-themes": "^0.2.0", - "next-transpile-modules": "^10.0.0", "nodemailer": "^6.7.8", "otplib": "^12.0.1", "qrcode": "^1.5.1",