Index: lib/src/compiler.dart |
diff --git a/lib/src/compiler.dart b/lib/src/compiler.dart |
index c4e66221377248e846dc75c71b91e9bfecb6b240..7b4b11a90d23330f71321cf20a69aab3b6822f08 100644 |
--- a/lib/src/compiler.dart |
+++ b/lib/src/compiler.dart |
@@ -277,7 +277,10 @@ class BatchCompiler extends AbstractCompiler { |
var loadedLibs = new LinkedHashSet<Uri>(); |
- var htmlOutDir = path.dirname(getOutputPath(source.uri)); |
+ // If we're generating code, convert the HTML file as well. |
ochafik
2016/03/04 23:27:57
+1 !
|
+ // Otherwise, just search for Dart sources to analyze. |
+ var htmlOutDir = |
+ _jsGen != null ? path.dirname(getOutputPath(source.uri)) : null; |
for (var script in scripts) { |
Source scriptSource = null; |
var srcAttr = script.attributes['src']; |
@@ -300,12 +303,16 @@ class BatchCompiler extends AbstractCompiler { |
if (scriptSource != null) { |
var lib = context.computeLibraryElement(scriptSource); |
_compileLibrary(lib, notifier); |
- script.replaceWith(_linkLibraries(lib, loadedLibs, from: htmlOutDir)); |
+ if (htmlOutDir != null) { |
+ script.replaceWith(_linkLibraries(lib, loadedLibs, from: htmlOutDir)); |
+ } |
} |
} |
- fileSystem.writeAsStringSync( |
- getOutputPath(source.uri), document.outerHtml + '\n'); |
+ if (htmlOutDir != null) { |
+ fileSystem.writeAsStringSync( |
+ getOutputPath(source.uri), document.outerHtml + '\n'); |
+ } |
} |
html.DocumentFragment _linkLibraries( |