Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: lib/src/codegen/html_codegen.dart

Issue 1645343002: Builds / serves multiple HTML files. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Address comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/html_codegen.dart
diff --git a/lib/src/codegen/html_codegen.dart b/lib/src/codegen/html_codegen.dart
index 4db7c52c6c2658ca5d5734637662ee3084d3f699..cd594d43afb69964971539cc7d12974753707dd4 100644
--- a/lib/src/codegen/html_codegen.dart
+++ b/lib/src/codegen/html_codegen.dart
@@ -68,10 +68,16 @@ String generateEntryHtml(HtmlSourceNode root, AbstractCompiler compiler) {
}
});
+ var rootDir = path.dirname(root.uri.path);
+ String rootRelative(String fullPath) {
+ return path.relative(path.join(compiler.inputBaseDir, fullPath),
+ from: rootDir);
+ }
+
var fragment = new DocumentFragment();
for (var resource in resources) {
- var resourcePath =
- resourceOutputPath(resource.uri, root.uri, options.runtimeDir);
+ var resourcePath = rootRelative(
+ resourceOutputPath(resource.uri, root.uri, options.runtimeDir));
var ext = path.extension(resourcePath);
if (resource.cachingHash != null) {
resourcePath = _addHash(resourcePath, resource.cachingHash);
@@ -92,7 +98,7 @@ String generateEntryHtml(HtmlSourceNode root, AbstractCompiler compiler) {
var info = lib.info;
if (info == null) continue;
var uri = info.library.source.uri;
- var jsPath = compiler.getModulePath(uri);
+ var jsPath = rootRelative(compiler.getModulePath(uri));
if (uri == scriptUri) mainLibraryName = compiler.getModuleName(uri);
if (lib.cachingHash != null) {
jsPath = _addHash(jsPath, lib.cachingHash);
« no previous file with comments | « no previous file | lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698