Migrating from Coffeescript to ES6


#1

I’m trying to slowly migrate a large project from Coffeescript to ES6.

However, having both coffeescript and grigio:babel in a project results in the following error from a .coffee file. Is there a workaround for this that would allow both to work for the interim period of migration?

W20150709-16:16:56.980(-4)? (STDERR) ReferenceError: exports is not defined
W20150709-16:16:56.984(-4)? (STDERR)     at __coffeescriptShare (packages/mizzao:turkserver/lib/timers.coffee:1:1)
W20150709-16:16:56.984(-4)? (STDERR)     at /tmp/meteor-test-runikvt37/.meteor/local/build/programs/server/packages/mizzao_turkserver.js:4103:4
W20150709-16:16:56.984(-4)? (STDERR)     at packages/mizzao:turkserver/admin/admin.coffee:2:1
W20150709-16:16:56.985(-4)? (STDERR)     at /tmp/meteor-test-runikvt37/.meteor/local/build/programs/server/boot.js:222:10
W20150709-16:16:56.985(-4)? (STDERR)     at Array.forEach (native)
W20150709-16:16:56.985(-4)? (STDERR)     at Function._.each._.forEach (/home/mao/.meteor/packages/meteor-tool/.1.1.3.ev53no++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150709-16:16:56.985(-4)? (STDERR)     at /tmp/meteor-test-runikvt37/.meteor/local/build/programs/server/boot.js:117:5


#2

Hmm, this had something to do with using the export class syntax of ES6. Will follow up with more information.


#3

import/export aka ES6 modules is not yet supported.