Skip to content

Commit

Permalink
remove comment
Browse files Browse the repository at this point in the history
  • Loading branch information
asafshen committed Oct 28, 2024
1 parent db75ac1 commit 782eb0c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/sdks/nextjs-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"@open-wc/rollup-plugin-html": "^1.2.5",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-alias": "5.1.1",
"@rollup/plugin-alias": "5.1.1",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-typescript": "^8.5.0",
"@swc/core": "^1.4.0",
Expand Down
43 changes: 17 additions & 26 deletions packages/sdks/nextjs-sdk/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import { nodeResolve } from '@rollup/plugin-node-resolve';
import alias from '@rollup/plugin-alias';

const nextSubPackages = [
'next/server',
'next/dynamic',
'next/navigation',
'next/router',
'next/link',
'next/headers',
]
'next/server',
'next/dynamic',
'next/navigation',
'next/router',
'next/link',
'next/headers'
];

// Common plugins for all configurations
const commonPlugins = (outputDir) => [
Expand All @@ -36,14 +36,14 @@ const commonPlugins = (outputDir) => [
preserveDirectives({ supressPreserveModulesWarning: true }),
nodeResolve(),
// commonjs(),
alias({
entries: nextSubPackages.map((alias) => {
// Append the `.js` suffix to Next.js sub-packages
// to ensure compatibility with Node environments
return { find: alias, replacement: `${alias}.js` }
})
}),
autoExternal(),
alias({
entries: nextSubPackages.map((alias) => {
// Append the `.js` suffix to Next.js sub-packages
// to ensure compatibility with Node environments
return { find: alias, replacement: `${alias}.js` };
})
}),
autoExternal()
// terser()
];

Expand All @@ -55,10 +55,7 @@ const configurations = ['server', 'client', ''].map((entry) => {

return {
input: inputPath,
external: [
'react',
...nextSubPackages.map((alias) => `${alias}.js`)
],
external: ['react', ...nextSubPackages.map((alias) => `${alias}.js`)],
onwarn(warning, warn) {
if (
warning.code === 'MODULE_LEVEL_DIRECTIVE' &&
Expand Down Expand Up @@ -103,13 +100,7 @@ const endConfigurations = ['server', 'client', ''].map((entry) => {
del({
hook: 'buildEnd',
targets: srcDir
}),
// replace({
// 'next/dynamic': 'next/dynamic.js',
// // 'process.env.NODE_ENV': JSON.stringify('production'),
// // __buildDate__: () => JSON.stringify(new Date()),
// // __buildVersion: 15,
// })
})
]
};
});
Expand Down

0 comments on commit 782eb0c

Please sign in to comment.