CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-swc--core-darwin-arm64

Platform-specific native binary for SWC TypeScript/JavaScript compiler on macOS ARM64 architecture

89

1.15x
Overview
Eval results
Files

task.mdevals/scenario-9/

Module Bundler with Circular Dependency Support

Build a module bundler that can bundle JavaScript modules with circular dependencies into a single output file.

Requirements

The bundler should:

  1. Accept an entry point file path and an output file path as configuration
  2. Bundle multiple JavaScript modules into a single executable JavaScript file
  3. Correctly handle circular dependencies between modules (where module A imports from module B, and module B imports from module A)
  4. Resolve module dependencies recursively starting from the entry point
  5. Generate a bundled output that executes without errors when circular dependencies are present

Test Cases

Create test files to verify the bundler behavior:

  • Bundle a simple two-file circular dependency (moduleA imports moduleB, moduleB imports moduleA) and verify the output executes correctly @test
  • Bundle a three-module circular chain (A → B → C → A) and verify all exported values are accessible @test
  • Bundle modules with mixed circular and non-circular dependencies and verify correct execution @test

Implementation

@generates

API

/**
 * Bundles JavaScript modules starting from an entry point.
 *
 * @param {Object} options - Bundling configuration
 * @param {string} options.entry - Path to the entry point file
 * @param {string} options.output - Path where the bundled file should be written
 * @returns {Promise<void>} Resolves when bundling is complete
 */
async function bundle(options) {
  // IMPLEMENTATION HERE
}

module.exports = { bundle };

Dependencies { .dependencies }

@swc/core { .dependency }

Provides JavaScript bundling capabilities with circular dependency resolution support.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-swc--core-darwin-arm64

tile.json