Skip to content

Commit

Permalink
rollup: externals
Browse files Browse the repository at this point in the history
  • Loading branch information
peterphanouvong committed Nov 13, 2023
1 parent edac647 commit 6b9a701
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import dts from 'rollup-plugin-dts';

export default [
{
plugins: [babel({babelHelpers: 'bundled'}), terser(), nodeResolve()],
plugins: [babel({babelHelpers: 'bundled'}), terser()],
input: 'src/index.js',
output: [
{
Expand All @@ -22,7 +22,12 @@ export default [
exports: 'named'
}
],
external: ['react', 'react-dom']
external: [
'react',
'react-dom',
'jwt-decode',
'@kinde-oss/kinde-typescript-sdk'
]
},
{
plugins: [babel({babelHelpers: 'bundled'}), terser()],
Expand All @@ -40,10 +45,19 @@ export default [
sourcemap: true,
exports: 'named'
}
],
external: [
'react',
'jwt-decode',
'@kinde-oss/kinde-typescript-sdk',
'next/server',
'next/navigation',
'next/headers',
'cookie'
]
},
{
plugins: [babel({babelHelpers: 'bundled'}), terser(), nodeResolve()],
plugins: [babel({babelHelpers: 'bundled'}), terser()],
input: 'src/components/index.js',
output: [
{
Expand All @@ -59,25 +73,7 @@ export default [
exports: 'named'
}
],
external: ['react', 'react-dom']
},
{
plugins: [babel({babelHelpers: 'bundled'}), terser()],
input: 'src/middleware/index.js',
output: [
{
file: 'dist/middleware/index.js',
format: 'esm',
sourcemap: true,
exports: 'named'
},
{
file: 'dist/middleware/cjs/index.js',
format: 'cjs',
sourcemap: true,
exports: 'named'
}
]
external: ['react', 'react-dom', '@kinde-oss/kinde-typescript-sdk']
},
{
plugins: [babel({babelHelpers: 'bundled'}), terser()],
Expand All @@ -95,7 +91,8 @@ export default [
sourcemap: true,
exports: 'named'
}
]
],
external: ['next/server', 'jwt-decode', '@kinde-oss/kinde-typescript-sdk']
},
{
input: './types.d.ts',
Expand Down

0 comments on commit 6b9a701

Please sign in to comment.