Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
0 answers
48 views

Transpile Common JS modules to AMD with return statement

I have a commonjs module I need to transpile to the AMD / requirejs format to integrate it in a larger codebase. I am using gulp + babel to build, and so far I have tried using the babel plugin The ...
Carlo's user avatar
  • 2,113
2 votes
1 answer
1k views

Uncaught TypeError: Cannot set property '[any AMD]' of undefined

Example scrollmagic module, but it happens with others too. I suspect it is for Babel but not sure. How can we reproduce this bug? Git clone https://github.com/zurb/foundation-zurb-template ...
York Xtrem's user avatar
0 votes
0 answers
20 views

File is not evaluated when `import`

There is a b.js const test = 'test'; console.log(test); module.exports = {test}; when importing a file const a = require('./b'); I notice that test is not printed out unless I change the name of ...
Hao's user avatar
  • 1,554
56 votes
2 answers
18k views

How to stop babel from transpiling 'this' to 'undefined' (and inserting "use strict")

EDIT: This is not about fat arrows. It's also not about passing this to an IIFE. It's a transpiler-related question. So I've created a simple pub-sub for a little app I'm working on. I wrote it in ...
JR Halchak's user avatar
0 votes
1 answer
167 views

Integrating React to a build flow with module transpilation with Babel

I am currently having trouble with module transpilation with babel. when I am transpiling code to AMD modules with babel, I can make it work in browser by including requirejs library. But when I try ...
fklt's user avatar
  • 1