Platform-specific native binary for SWC TypeScript/JavaScript compiler on macOS ARM64 architecture
89
Build a compilation tool that automatically adds polyfills for modern JavaScript features based on target browser environments. The tool should analyze code and inject only the necessary polyfills to ensure compatibility with specified browsers.
Your tool should:
// Modern JavaScript code
async function fetchUsers() {
const response = await fetch('/api/users');
const users = await response.json();
return users.filter(user => user.name.includes('John'));
}
const numbers = [1, 2, 3, 4, 5];
const hasThree = numbers.includes(3);When targeting older browsers (e.g., IE 11), the tool should:
When targeting modern browsers (e.g., Chrome 90+), the tool should:
@generates
/**
* Compiles JavaScript code with automatic polyfilling based on target browsers
*
* @param {string} code - The JavaScript source code to compile
* @param {object} options - Compilation options
* @param {string|string[]} options.targets - Target browsers (browserlist format)
* @param {boolean} options.useBuiltIns - Enable usage-based polyfilling (default: 'usage')
* @param {number} options.corejs - Core-js version to use (2 or 3)
* @returns {Promise<{code: string}>} Compiled code with polyfills
*/
async function compile(code, options) {
// IMPLEMENTATION HERE
}
module.exports = { compile };Provides fast JavaScript/TypeScript compilation with environment-based transformation and polyfill support.
Provides modular standard library polyfills for JavaScript.
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