Skip to content

Commit

Permalink
Issue #PS-2103: Add Workspace UI implementation in admin portal
Browse files Browse the repository at this point in the history
  • Loading branch information
Aar-if committed Oct 7, 2024
1 parent 2416f93 commit 68fedf3
Show file tree
Hide file tree
Showing 234 changed files with 17,771 additions and 68 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

Expand Down
44 changes: 44 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
// next.config.mjs
/** @type {import('next').NextConfig} */
import nextI18nextConfig from "./next-i18next.config.js";
import { NextFederationPlugin } from '@module-federation/nextjs-mf';
const url = process.env.REMOTE_EDITOR_URL

const remotes = (isServer) => {
const location = isServer ? 'ssr' : 'chunks';
return {
editor: `editor@${url}/_next/static/${location}/remoteEntry.js`,
};
};

const nextConfig = {
eslint: {
Expand All @@ -10,6 +19,41 @@ const nextConfig = {
trailingSlash: false,
reactStrictMode: true,
i18n: nextI18nextConfig.i18n,

distDir: 'build',
images: {
unoptimized: true,
},
reactStrictMode: true,
experimental: {
esmExternals: false,
},
async rewrites() {
return [
{
source: '/action/:path*', // Match any route starting with /action/
destination: '/api/proxy?path=/action/:path*', // Forward to the proxy API
},
{
source: '/api/:path*', // Match any route starting with /api/
destination: '/api/proxy?path=/api/:path*', // Forward to the proxy API
}
];
},
webpack: (config, { isServer }) => {
config.plugins.push(
new NextFederationPlugin({
name: 'admin',
filename: 'static/chunks/remoteEntry.js',
remotes: remotes(isServer),
exposes: {
// Add exposed modules here, e.g., './Component': './path/to/component'
},

})
);
return config;
},
};

export default nextConfig;
Loading

0 comments on commit 68fedf3

Please sign in to comment.