Platform-specific native binary for SWC TypeScript/JavaScript compiler on macOS ARM64 architecture
89
A build tool utility that transforms JavaScript/TypeScript code by resolving custom path aliases to relative paths.
import { util } from "@utils/helper"; with path mapping {"@utils/*": ["./src/utilities/*"]}, the transformed code output contains the resolved import path "./src/utilities/helper" @testimport App from "@components/App"; with path mapping {"@components/*": ["./src/components/*"]}, the transformed code output contains the resolved import path "./src/components/App" @testimport { config } from "lib/config"; with baseUrl "./src" and no path mappings, the transformed code resolves the import relative to the baseUrl @testimport React from "react"; with path mappings configured, the transformed code preserves the external package import unchanged as "react" @test@generates
/**
* 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,
};Provides TypeScript/JavaScript compilation and transformation support with path mapping capabilities.
Install with Tessl CLI
npx tessl i tessl/npm-swc--core-darwin-arm64docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10