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-4/

Module Path Resolver

A build tool utility that transforms JavaScript/TypeScript code by resolving custom path aliases to relative paths.

Capabilities

Transforms path-mapped imports

  • Given source code import { util } from "@utils/helper"; with path mapping {"@utils/*": ["./src/utilities/*"]}, the transformed code output contains the resolved import path "./src/utilities/helper" @test
  • Given source code import App from "@components/App"; with path mapping {"@components/*": ["./src/components/*"]}, the transformed code output contains the resolved import path "./src/components/App" @test

Handles baseUrl configuration

  • Given source code import { config } from "lib/config"; with baseUrl "./src" and no path mappings, the transformed code resolves the import relative to the baseUrl @test

Preserves unmapped imports

  • Given source code import React from "react"; with path mappings configured, the transformed code preserves the external package import unchanged as "react" @test

Implementation

@generates

API

/**
 * Transforms JavaScript/TypeScript source code by resolving path-mapped imports.
 *
 * @param {string} sourceCode - The source code to transform.
 * @param {Object} options - Transformation options.
 * @param {string} [options.baseUrl] - The base URL for module resolution.
 * @param {Object.<string, string[]>} [options.paths] - Path mapping configuration (e.g., {"@utils/*": ["./src/utilities/*"]}).
 * @returns {Promise<string>} The transformed code with resolved import paths.
 */
async function transformPathMappings(sourceCode, options) {
  // IMPLEMENTATION HERE
}

module.exports = {
  transformPathMappings,
};

Dependencies { .dependencies }

@swc/core { .dependency }

Provides TypeScript/JavaScript compilation and transformation support with path mapping capabilities.

Install with Tessl CLI

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

tile.json