JSPM

@closure-next/vite

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q26282F
  • License Apache-2.0

Vite plugin for Closure Next

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@closure-next/vite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Closure Next Vite Plugin

    Vite integration for Closure Next, providing fast development and optimized builds.

    Installation

    npm install @closure-next/vite

    Usage

    // vite.config.ts
    import { defineConfig } from 'vite';
    import { closureNextVite } from '@closure-next/vite';
    
    export default defineConfig({
      plugins: [
        closureNextVite({
          hmr: true,
          paths: {
            // Custom module resolution
          }
        })
      ]
    });

    Features

    • πŸ”Œ Plug-and-play integration
    • ⚑️ Lightning-fast HMR
    • πŸ”§ TypeScript support
    • πŸ—ΊοΈ Custom module resolution
    • πŸ“¦ Optimized production builds
    • πŸ› οΈ Development tools

    Options

    hmr

    Enable Hot Module Replacement for Closure components.

    closureNextVite({
      hmr: true
    })

    paths

    Configure custom module resolution paths.

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

    Example Configuration

    Development Mode

    // vite.config.ts
    import { defineConfig } from 'vite';
    import { closureNextVite } from '@closure-next/vite';
    
    export default defineConfig({
      mode: 'development',
      plugins: [
        closureNextVite({
          hmr: true,
          paths: {
            '@closure-next': './node_modules/@closure-next'
          }
        })
      ],
      server: {
        hmr: true
      }
    });

    Production Mode

    // vite.config.ts
    import { defineConfig } from 'vite';
    import { closureNextVite } from '@closure-next/vite';
    
    export default defineConfig({
      mode: 'production',
      plugins: [
        closureNextVite({
          hmr: false
        })
      ],
      build: {
        target: 'esnext',
        minify: 'terser'
      }
    });

    TypeScript Support

    The plugin includes TypeScript definitions:

    import { closureNextVite } from '@closure-next/vite';
    import type { UserConfig } from 'vite';
    
    const config: UserConfig = {
      plugins: [
        closureNextVite({
          // Type-checked options
        })
      ]
    };

    Development Features

    Hot Module Replacement

    The plugin automatically handles HMR for Closure components:

    // Your component will automatically reload when changed
    import { Component } from '@closure-next/core';
    
    class MyComponent extends Component {
      // Changes here trigger HMR
    }

    Development Tools

    The plugin integrates with Vite's development tools:

    • Source maps for debugging
    • Fast refresh
    • Error overlay
    • Network proxy
    • Asset handling

    Production Optimization

    The plugin automatically configures production optimizations:

    • Code splitting
    • Tree shaking
    • Minification
    • Asset optimization
    • Module preloading