Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions examples/testapp/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import webpack from 'webpack';

export default {
output: 'export',
basePath: process.env.NODE_ENV === 'production' ? '/account-sdk' : undefined,
Expand All @@ -7,4 +9,21 @@ export default {
// GitHub discussion for supporting biome: https://github.com/vercel/next.js/discussions/59347
ignoreDuringBuilds: true,
},
webpack: (config, { isServer }) => {
// Exclude Node.js built-in modules from client bundle
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
zlib: false,
};

// Ignore node:zlib imports in client-side code
config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /^node:zlib$/,
})
);
}
return config;
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming consumers of our SDK don't have to do this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to Implement environment specific exports (and removed this)

};
1 change: 1 addition & 0 deletions examples/testapp/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const PAGES = [
'/payment',
'/pay-playground',
'/subscribe-playground',
'/prolink-playground',
];

export function Layout({ children }: LayoutProps) {
Expand Down
Loading