Questions tagged [transpiler]

A transpiler is a compiler that translates the source code of one high-level programming language to the source code of another high-level programming language.

Transpilers are also known as compilers.

429 questions
5
votes
2 answers

What is transpiler and what is exactly work of transpiler?

I would like to know what a transpiler is and what it actually does?
5
votes
2 answers

Call javascript that contains 'const' from java?

I am trying to use a transpiling tool that has been developed in js and was available in GitHub. This transpiler is capable to convert the javascript code to java. I want to call the tool via java code so that I could read js files in java and…
Saumitra Kamath
  • 51
  • 1
  • 1
  • 5
5
votes
1 answer

TypeScript should assign to `this` before `_super` call in transpiled output for ES5?

I use dependency injection for all my child classes that extends an abstract class. The problem that in abstract constructor class I launch a method that I planned to override in its children, if necessary. I stuck in problem that my injected…
Roman M. Koss
  • 970
  • 1
  • 15
  • 33
5
votes
1 answer

Using dart as transpiler with node.js

Is there a way to use the dart language with node.js? Something like livescript, coffeescript, typescript, etc. Thanks!
user5526811
5
votes
2 answers

Babel transpiling es7 class decorators Unexpected token error

im working on an Aurelia app that used es6 and es7 code, im trying to transpile the code using babel. I have the following in my packages.json file "scripts": { "babel": "babel --stage 1 -d AureliaWeb/ ../Test/Aurelia/ --extends babelrc", I…
5
votes
1 answer

Using haxe as a transpiler between c++ and JavaScript

Firstly I apologise for the long post. I have been asking a few questions about haxe and its suitability as a tool to solve a problem I am facing. I have very limited knowledge of haxe but what I do know is my ideal role for haxe in my project is…
codetemplar
  • 671
  • 6
  • 19
5
votes
1 answer

Passing a preset to babel programmatically

I'm struggling to use babel programmatically. "use strict"; const babel = require("babel-core") , es2015 = require("babel-preset-es2015") ; babel.transformFile("my-file.js", { presets: [es2015] }, (err, result) => console.log(err ||…
Ionică Bizău
  • 109,027
  • 88
  • 289
  • 474
5
votes
12 answers

Why is it not possible to create a practical Perl to Python source code converter?

It would be nice if there existed a program that automatically transforms Perl code to Python code, making the resultant Python program as readable and maintainable as the original one, let alone working the same way. The most obvious solution would…
P Shved
  • 96,026
  • 17
  • 121
  • 165
5
votes
2 answers

How to compile a file with babel CLI

I'm trying to compile a simple es6 file with babel CLI Given the details below: what's going wrong? $ node --version v5.0.0 $ npm --version 3.3.6 $ npm init $ npm install --save-dev babel-cli $ echo -e 'import url from…
Bosh
  • 8,138
  • 11
  • 51
  • 77
5
votes
2 answers

Ember Cli - Transpiling vendor ES6 dependency in ember-cli-build?

I'm writing an Ember.js application using Ember Cli, and I want to include a non-bower dependency - basically a dependency from my vendor folder. The instructions on doing so is telling me to add the following line into my ember-cli-build.js…
Brian Frisch
  • 507
  • 2
  • 7
4
votes
1 answer

Adding dependencies to the "ui" package of a Turborepo with Next.js throws Unexpected token 'export'

If you run npx degit vercel/turbo/examples/with-react-native-web with-react-native-web cd with-react-native-web yarn install To create a basic Turborepo that has a Nextjs application, a react-native mobile app with Expo and a ui package to share…
4
votes
1 answer

Webpack differences in default export between Typescript and Javascript

I have a React application with a page importing a component from another file. // code from IconPage.tsx import {AccountBalanceIcon} from './icons'; // Code from ./icons.ts export { default as AccountBalanceIcon } from…
oravecz
  • 1,146
  • 11
  • 16
4
votes
0 answers

TypeError: multi is not a function / default import from rollup-plugin-multi-input does not work from ESM package

I found a plugin rollup-plugin-multi-input which fixes the problem of not being able to specifiy a glob to the test rollup config. For the unt tests, the entry point is not a single entity from which an import graph can be derived. It is just a…
Plastikfan
  • 3,674
  • 7
  • 39
  • 54
4
votes
1 answer

How to transpile dependencies with @vue/cli 4.3.1

I have an app that has to work in IE11 Some dependencies like lodash use fat arrows (=>) and i want to target them to transpile them in es5. I consulted many other posts that address that problem but nothing seems to work in my case. My…
4
votes
1 answer

How to preserve variable name in Cheerp (a C++ to JavaScript transpiler)

I'm using Cheerp (https://www.leaningtech.com/cheerp/) to transpile some C++ code into JavaScript. Is there any option to preserve variable names? Looks like the names get always mangled Original C++ code: void myClass::myMethod(int32_T myParam,…
Gianluca Ghettini
  • 11,129
  • 19
  • 93
  • 159