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

Unified Diff: lib/src/utils.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 | « lib/src/server/server.dart ('k') | test/codegen/expect/collection/equality.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 6f92e2252729d004693d5977fbc2ef885af6e279..b1794f63cc3e2adffd0e1d35a83c8682d6ed30e8 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -314,7 +314,12 @@ String resourceOutputPath(Uri resourceUri, Uri entryUri, String runtimeDir) {
if (resourceUri.scheme != 'file') return null;
- var entryDir = path.dirname(entryUri.path);
+ var entryPath = entryUri.path;
+ // The entry uri is either a directory or a dart/html file. If the latter,
+ // trim the file.
+ var entryDir = entryPath.endsWith('.dart') || entryPath.endsWith('.html')
+ ? path.dirname(entryPath)
+ : entryPath;
var filepath = path.normalize(path.join(entryDir, resourceUri.path));
if (path.isWithin(runtimeDir, filepath)) {
filepath = path.relative(filepath, from: runtimeDir);
« no previous file with comments | « lib/src/server/server.dart ('k') | test/codegen/expect/collection/equality.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698