1.1.0 β€’ Published 8 months ago

@closure-next/rollup v1.1.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

Closure Next Rollup Plugin

Rollup integration for Closure Next, providing efficient bundling and code splitting.

Installation

npm install @closure-next/rollup

Usage

// rollup.config.js
import { closureNextRollup } from '@closure-next/rollup';

export default {
  input: 'src/index.ts',
  plugins: [
    closureNextRollup({
      codeSplitting: true,
      paths: {
        // Custom module resolution
      }
    })
  ]
};

Features

  • πŸ”Œ Plug-and-play integration
  • πŸ“¦ Automatic code splitting
  • πŸ—ΊοΈ Custom module resolution
  • πŸ”§ TypeScript support
  • ⚑️ Efficient bundling
  • πŸ› οΈ Development tools

Options

codeSplitting

Enable code splitting for Closure components.

closureNextRollup({
  codeSplitting: true
})

paths

Configure custom module resolution paths.

closureNextRollup({
  paths: {
    '@components': './src/components'
  }
})

Example Configuration

Development Mode

// 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'
      }
    })
  ]
};

Production Mode

// 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()
  ]
};

TypeScript Support

The plugin includes TypeScript definitions:

import { closureNextRollup } from '@closure-next/rollup';
import type { RollupOptions } from 'rollup';

const config: RollupOptions = {
  plugins: [
    closureNextRollup({
      // Type-checked options
    })
  ]
};

Code Splitting

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');

Module Resolution

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';

Development Tools

The plugin supports various development features:

  • Source maps for debugging
  • Watch mode
  • Fast builds
  • Tree shaking
  • Asset handling

Production Optimization

The plugin automatically configures production optimizations:

  • Code splitting
  • Tree shaking
  • Dead code elimination
  • Module concatenation
1.1.0

8 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago