Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ yarn-error.log*

# vscode plugin
*.vsix

# npm pack artifacts
*.tgz
9 changes: 9 additions & 0 deletions packages/raystack/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Exclude test files
dist/**/__tests__/**
# Exclude dev files
dist/vitest.setup.*
dist/figma/**
# Exclude bundled dependencies
dist/node_modules/**
dist/_virtual/**

27 changes: 26 additions & 1 deletion packages/raystack/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,31 @@ const configs = [
}
];

// Externalize all dependencies and peer dependencies
// This prevents bundling dependencies and reduces package size significantly
const external = [
'react',
'react-dom',
'react-dom/client',
'react/jsx-runtime',
// Add new external dependencies from package.json here as well
'@ariakit/react',
'@radix-ui/react-icons',
'@tanstack/match-sorter-utils',
'@tanstack/react-table',
'@tanstack/table-core',
'class-variance-authority',
'cmdk',
'color',
'dayjs',
'prism-react-renderer',
'radix-ui',
'react-day-picker',
'sonner',
/^dayjs\/plugin\/.*/,
/^@radix-ui\/.*/
];

const rollupConfig = configs.map(conf => {
return {
input: conf.inputPath + '/index.tsx',
Expand All @@ -100,7 +125,7 @@ const rollupConfig = configs.map(conf => {
preserveModulesRoot: conf.inputPath
}
],
external: ['react', 'react-dom', 'react-dom/client', 'react/jsx-runtime'],
external,
plugins: createPlugins({
rootDir: conf.inputPath,
declarationDir: conf.outputPath
Expand Down
Loading