Skypager Bundler Helpers

39.0.0 · active · verified Sun Apr 19

The `skypager-helpers-bundler` package is an integral part of the Skypager framework, a universal JavaScript runtime and feature framework designed to streamline project creation, building, and deployment across various environments. This helper specifically provides a fluent API for simplifying Webpack configuration, offering presets while retaining an 'escape hatch' for advanced customization. As part of a larger monorepo, it follows the framework's philosophy of extending the core runtime with specialized 'Helper Classes' for different concerns. The package is currently at version 39.0.0, indicating a mature and extensively iterated codebase. While specific release cadences for individual helpers within the Skypager monorepo are not explicitly stated, the overarching project maintains an active development status, with updates as recent as July 2023 for the main `skypager` repository. Its key differentiator is the abstraction over Webpack, allowing developers to manage complex build processes with a more conversational, declarative style, integrating seamlessly with the Skypager runtime's contextual and lifecycle management capabilities.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates initializing the Skypager runtime and registering a `Bundler` helper to configure Webpack for a project, including entry, output, and custom alias settings.

import runtime from 'skypager';
import { Bundler } from 'skypager-helpers-bundler';
import path from 'path';

async function setupBundler() {
  await runtime.start();
  
  const projectRoot = process.cwd();
  
  runtime.use(Bundler, { 
    name: 'my-project-bundler',
    entry: path.resolve(projectRoot, 'src/index.js'),
    output: {
      path: path.resolve(projectRoot, 'dist'),
      filename: 'bundle.js'
    },
    // Example: add a preset or custom config options
    presets: ['react-app', 'typescript'],
    configureWebpack: (config) => {
      config.resolve.alias = { '@src': path.resolve(projectRoot, 'src') };
      return config;
    }
  });

  const myBundler = runtime.feature('my-project-bundler');

  console.log('Bundler helper initialized:', myBundler.name);
  // In a real application, you would then call methods like myBundler.build() or myBundler.serve()
  // For demonstration, we just show initialization.
  console.log('Webpack entry point:', myBundler.options.entry);
  console.log('Webpack output path:', myBundler.options.output.path);
}

setupBundler().catch(console.error);

view raw JSON →