Rollup integration for Closure Next, providing efficient bundling and code splitting.
npm install @closure-next/rollup
// rollup.config.js
import { closureNextRollup } from '@closure-next/rollup';
export default {
input: 'src/index.ts',
plugins: [
closureNextRollup({
codeSplitting: true,
paths: {
// Custom module resolution
}
})
]
};
- 🔌 Plug-and-play integration
- 📦 Automatic code splitting
- 🗺️ Custom module resolution
- 🔧 TypeScript support
- ⚡️ Efficient bundling
- 🛠️ Development tools
Enable code splitting for Closure components.
closureNextRollup({
codeSplitting: true
})
Configure custom module resolution paths.
closureNextRollup({
paths: {
'@components': './src/components'
}
})
// rollup.config.js
import { closureNextRollup } from '@closure-next/rollup';
import typescript from '@rollup/plugin-typescript';
export default {
input: 'src/index.ts',
output: {
dir: 'dist',
format: 'esm',
sourcemap: true
},
plugins: [
typescript(),
closureNextRollup({
codeSplitting: true,
paths: {
'@closure-next': './node_modules/@closure-next'
}
})
]
};
// rollup.config.js
import { closureNextRollup } from '@closure-next/rollup';
import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
export default {
input: 'src/index.ts',
output: {
dir: 'dist',
format: 'esm',
sourcemap: false
},
plugins: [
typescript(),
closureNextRollup({
codeSplitting: true
}),
terser()
]
};
The plugin includes TypeScript definitions:
import { closureNextRollup } from '@closure-next/rollup';
import type { RollupOptions } from 'rollup';
const config: RollupOptions = {
plugins: [
closureNextRollup({
// Type-checked options
})
]
};
The plugin automatically handles code splitting for Closure components:
// Your code
import { Component } from '@closure-next/core';
// Dynamic imports are automatically code-split
const MyComponent = await import('./components/MyComponent');
Custom module resolution paths can be configured:
closureNextRollup({
paths: {
'@components': './src/components',
'@utils': './src/utils'
}
})
This allows imports like:
import { MyComponent } from '@components/MyComponent';
import { utils } from '@utils/index';
The plugin supports various development features:
- Source maps for debugging
- Watch mode
- Fast builds
- Tree shaking
- Asset handling
The plugin automatically configures production optimizations:
- Code splitting
- Tree shaking
- Dead code elimination
- Module concatenation