diff --git a/package.json b/package.json index abd2005..7f24fb1 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,9 @@ "author": "cramforce", "license": "Apache-2.0", "devDependencies": { + "@angular/common": "^2.4.7", + "@angular/core": "^2.4.7", + "@angular/platform-browser": "github:angular/platform-browser-builds#master-es2015", "babel-plugin-transform-object-rest-spread": "^6.20.2", "babel-preset-es2015": "^6.18.0", "babel-preset-stage-0": "^6.16.0", @@ -33,7 +36,9 @@ "promise-pjs": "^1.1.2", "react": "^15.4.1", "react-dom": "^15.4.1", - "tap": "^8.0.0" + "rxjs": "^5.1.1", + "tap": "^8.0.0", + "zone.js": "^0.7.7" }, "dependencies": { "babel-plugin-transform-es2015-modules-commonjs": "^6.18.0", diff --git a/splittable.js b/splittable.js index c90742d..467ddbf 100644 --- a/splittable.js +++ b/splittable.js @@ -239,8 +239,13 @@ exports.getGraph = function(entryModules, config) { transform(babel, { babelrc: false, plugins: [ + require.resolve("babel-plugin-transform-export-extensions"), require.resolve("babel-plugin-transform-es2015-modules-commonjs"), - ] + ], + // Also transform node_modules. This should be safe, since we only + // do module discovery here. + ignore: false, + global: true, }); b.on('package', function(pkg) { @@ -291,6 +296,11 @@ exports.getGraph = function(entryModules, config) { if (seenTransform[filename]) { return; // We only care about the first transform per file. } + if (filename.indexOf('node_modules/') != -1) { + // The only once hack doesn't work with node_modules because + // the primary transform is not global. + return; + } seenTransform[filename] = true; filename = relativePath(process.cwd(), filename); // Copy transformed code into shadow path. Files in this path diff --git a/test/module-regression/angular.js b/test/module-regression/angular.js new file mode 100644 index 0000000..0ab9ef6 --- /dev/null +++ b/test/module-regression/angular.js @@ -0,0 +1 @@ +import { platformBrowser } from '@angular/platform-browser/index'; \ No newline at end of file diff --git a/third_party/closure-compiler/closure-compiler-1.0-SNAPSHOT.jar b/third_party/closure-compiler/closure-compiler-1.0-SNAPSHOT.jar index 00d77c8..dbd3c10 100644 Binary files a/third_party/closure-compiler/closure-compiler-1.0-SNAPSHOT.jar and b/third_party/closure-compiler/closure-compiler-1.0-SNAPSHOT.jar differ