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
0
votes
1 answer

Avoiding the "default" property indirection with babel

I am using babel to transpile ES2015 code to ES5 & RequireJS. But when I use the following syntax: const o = { foo: 'foo' }; export default o; The transpiled result is an object with a default property on it. ie. it is currently transpiled to…
Ben Aston
  • 53,718
  • 65
  • 205
  • 331
0
votes
2 answers

Visual Studio thinks there is a Syntax Error, but there isn't

I am building a website using Aurelia within Visual Studio, it has the babel transpiler and my config file looks as follows babelOptions: { "optional": [ "optimisation.modules.system", "es7.decorators", …
christopher clark
  • 2,026
  • 5
  • 28
  • 47
0
votes
1 answer

Understanding Emscripten/ASM.js and the browser sandbox

Sorry for the basic question here. I'm trying to wrap my head around Emscripten, ASM.js, and compiling lower level languages to javascript. Here is what I don't understand. You can do things in a native C program that you can't (and shouldn't) do in…
Dominic P
  • 2,284
  • 2
  • 27
  • 46
0
votes
1 answer

Babel/Npm - local vs global error

I'm trying to transpile an ES6 file using Babel - but NPM doesn't like the command babel src --out-dir output which is run using a script in my package.json. However, when I install Babel globally and run the same command without using the script,…
0
votes
1 answer

error when importing modules with es2015 syntax and babel transpilation to es5

I got problems with transpiling es2015 code to to ES5. Problem happens with module imports: import * as express from "express" is transpiled to: var _express = require("express"); var express = _interopRequireWildcard(_express); Which cause the…
Robert Brax
  • 6,508
  • 12
  • 40
  • 69
0
votes
1 answer

Unexpected leading underscore with babel's playground

Take a look at the following class "data" method. The method body contains a variable called "result", and is reassigned in the else if clause to an array. For some reason babel transpiles the aforementioned variable with a leading underscore. ES6…
elad.chen
  • 2,375
  • 5
  • 25
  • 37
0
votes
1 answer

When will ES6 methods like String.includes or Number.isInteger be included in Typescript?

One of the main benefits of Typescript listed on typescriptlang.org's homepage is the ability to write "State of the Art Javascript" that will compile to any ES3 or newer target. I can use many ES6 functions in Typescript, including let and const,…
Jon Crowell
  • 21,695
  • 14
  • 89
  • 110
0
votes
1 answer

Double transpile with ES6 bundler?

My current workflow, which is ES6-like but does not use module loading, is to use a Gulp task that runs my TypeScript code through tsc, producing ES6 output, and then again through Babel, producing ES5 output. I do this because TypeScript does not…
David Pfeffer
  • 38,869
  • 30
  • 127
  • 202
0
votes
1 answer

PhpStorm: Automatically deploy .css file after file watcher transpiled .scss file

I am deploying my project automatically to a remote server. All files that are changed are automatically uploaded to the server, so this is OK. I have a file watcher (Compass SCSS) to transpile my .scss into .css. When the .sccs file is changed it…
Bram
  • 1
  • 1
0
votes
2 answers

How do I load certain scripts for certain browsers?

I have an app up and running, and it works great in Chrome and Firefox. Safari is another story. For the sake of example, let's pretend this is my app: 'use strict'; const x = 3; function test(){ let y = 4; return y; }; When I run it in…
0
votes
0 answers

Transpiling from ecma6 to ecma5 in Aurelia not working

Does anyone have experience with transpiling from ecma6 to ecma5 in the aurealia tutorials? I am doing the production tutorial found here http://aurelia.io/docs.html#/aurelia/framework/1.0.0-beta.1.1.4/doc/article/a-production-setup When running…
Timo
  • 930
  • 2
  • 10
  • 22
0
votes
0 answers

Unexpected token export with ES2015 preset

I have created a package for my Express application and am importing it, in the package I have: 'use strict'; export default class BlogDatabase { ... } In .babelrc, I have presets: ["es2015"] (works normally and I have seen several questions…
user3104270
  • 625
  • 2
  • 10
  • 17
0
votes
1 answer

React not loading from babel.rc file

I am receiving a "module parse failed" error when trying to load my react app with Babel6 Stage-1. We initially ran browserify but I am now trying to port us completely to Babel6. babel.rc file { "presets": ["stage-1", "react"], "env": { …
Anthony Chung
  • 1,467
  • 2
  • 22
  • 44
0
votes
1 answer

Systemjs transpile async function with typescript

I'm able to build .ts files manually with tsc tool. And i see wrappers generated for async/await keywords. But I have problem to setup transpile on the fly using systemjs. index.htm:
Dizzy
  • 892
  • 3
  • 12
  • 24
0
votes
1 answer

After recent update vs code transpiling stopped working: tsc is not recognized as internal or external command

The title says all, anyway, after update yesterday visual code studio is not transpiling ts files to js saying tsc is not recognized asa external or internal command
blackHawk
  • 6,047
  • 13
  • 57
  • 100