Babel plugin that transforms eval() calls containing string literals by parsing and compiling the string content at transform time
Overall
score
98%
Build a command-line tool that transpiles modern JavaScript/TypeScript code to support older browsers and environments. The tool should support multiple input file types and provide appropriate transformations based on the file type.
The tool should accept a source file path as input and output transpiled JavaScript code that is compatible with older environments.
The transpiled output should be compatible with:
The tool should be invoked as:
node transpile.js <input-file>The output should be written to stdout.
@generates
/**
* Transpile a source file to browser-compatible JavaScript
* @param {string} filePath - Path to the source file
* @returns {Promise<string>} Transpiled JavaScript code
*/
async function transpileFile(filePath) {
// Implementation here
}
module.exports = { transpileFile };Provides JavaScript compilation and transformation capabilities.
Provides smart defaults for transforming modern JavaScript based on target environments.
Provides React JSX transformation support.
Provides TypeScript syntax support and type stripping.
Install with Tessl CLI
npx tessl i tessl/npm-babel-plugin-transform-evaldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10