alongubkin / alongubkin/spider

import/export broken because of IIFE

Đang mở
#104 0 bình luận 0 reaction 1 người được giao Được @alongubkin nhận Xem trên GitHub
bug contributing-getting-started
Ngôn ngữ chính
JavaScript
Star
1.3k
Fork
46
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I was examining our options for #50 and came across some annoying behavior. Because the compiler wraps everything in an IIFE, I can't seem to run generated ES6 module code through Traceur. For example, I ended up with code along the lines of:

``` es6
"use strict";
(function() {
import A from "A";
function B() { }
export default B;
})();
```

but that won't fly because Traceur expects the `import` to be outside of the IIFE.

For now, I've added an extra task to my Gruntfile to strip out the IIFE. However, we should either have a way to make the IIFE optional, or, preferably, hoist the imports out of it and return the exports from it.

(Or am I doing something horribly wrong? I'm basically compiling my code to ES6, then creating a System.js build from it, and finally loading it in Chrome. With the IIFE patch, that works well.)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.