Skip to content

Scheduling infrastructure for absolutely everyone.

Create local next.config.js, add storybook-static to .gitignore (#6544)

Alex van Andel3c07e305ce6d
diff --git a/apps/storybook/.gitignore b/apps/storybook/.gitignore
index a547bf36d8d..8c444bd2f45 100644
--- a/apps/storybook/.gitignore
+++ b/apps/storybook/.gitignore
@@ -8,6 +8,7 @@ pnpm-debug.log*
lerna-debug.log*
node_modules
+storybook-static
dist
dist-ssr
*.local
@@ -21,4 +22,4 @@ dist-ssr
*.ntvs*
*.njsproj
*.sln
-*.sw?
+*.sw?
\ No newline at end of file
diff --git a/apps/storybook/.storybook/main.js b/apps/storybook/.storybook/main.js
index db2ef9b7cf9..3b7382f1ed7 100644
--- a/apps/storybook/.storybook/main.js
+++ b/apps/storybook/.storybook/main.js
@@ -13,12 +13,13 @@ module.exports = {
"@storybook/addon-interactions",
"storybook-addon-rtl-direction",
"storybook-react-i18next",
- {
+ "storybook-addon-next",
+ /*{
name: "storybook-addon-next",
options: {
nextConfigPath: path.resolve(__dirname, "../../web/next.config.js"),
},
- },
+ },*/
],
framework: "@storybook/react",
core: {
diff --git a/apps/storybook/next.config.js b/apps/storybook/next.config.js
new file mode 100644
index 00000000000..605a550c9b3
--- /dev/null
+++ b/apps/storybook/next.config.js
@@ -0,0 +1,45 @@
+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" }));
+
+/** @type {import("next").NextConfig} */
+const nextConfig = {
+ reactStrictMode: true,
+ images: {
+ domains: ["www.datocms-assets.com"],
+ formats: ["image/avif", "image/webp"],
+ },
+ typescript: {
+ ignoreBuildErrors: true,
+ },
+ experimental: { images: { allowFutureImage: true } },
+ eslint: {
+ ignoreDuringBuilds: true,
+ },
+ webpack: (config, { isServer }) => {
+ if (!isServer) {
+ // don't resolve 'fs' module on the client to prevent this error on build --> Error: Can't resolve 'fs'
+ config.resolve.fallback = {
+ fs: false,
+ };
+ }
+ return config;
+ },
+};
+
+module.exports = () => plugins.reduce((acc, next) => next(acc), nextConfig);