From 5f6808ba92164f41bf9af57be8a4ba794c5083d8 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 22 Feb 2015 22:35:47 +1100 Subject: [PATCH] don't transform flow module nodes --- lib/babel/transformation/transformers/es6/modules.js | 6 ++++++ lib/babel/transformation/transformers/internal/modules.js | 3 +++ 2 files changed, 9 insertions(+) diff --git a/lib/babel/transformation/transformers/es6/modules.js b/lib/babel/transformation/transformers/es6/modules.js index 23b8a106c2..4957d22913 100644 --- a/lib/babel/transformation/transformers/es6/modules.js +++ b/lib/babel/transformation/transformers/es6/modules.js @@ -5,6 +5,9 @@ var t = require("../../../types"); exports.check = require("../internal/modules").check; exports.ImportDeclaration = function (node, parent, scope, file) { + // flow type + if (node.isType) return; + var nodes = []; if (node.specifiers.length) { @@ -24,6 +27,9 @@ exports.ImportDeclaration = function (node, parent, scope, file) { }; exports.ExportDeclaration = function (node, parent, scope, file) { + // flow type + if (t.isTypeAlias(node.declaration)) return; + var nodes = []; var i; diff --git a/lib/babel/transformation/transformers/internal/modules.js b/lib/babel/transformation/transformers/internal/modules.js index fabf23c62a..7def0f2ecc 100644 --- a/lib/babel/transformation/transformers/internal/modules.js +++ b/lib/babel/transformation/transformers/internal/modules.js @@ -24,6 +24,9 @@ exports.ImportDeclaration = resolveModuleSource; exports.ExportDeclaration = function (node, parent, scope) { resolveModuleSource.apply(null, arguments); + // flow type + if (node.isType) return; + var declar = node.declaration; if (node.default) {