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

Unified Diff: lib/build/web_components.dart

Issue 993673002: append html imports before the dart script tag (Closed) Base URL: git@github.com:dart-lang/web-components.git@master
Patch Set: add some js script tags to the head around the dart script tag Created 5 years, 9 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 | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/build/web_components.dart
diff --git a/lib/build/web_components.dart b/lib/build/web_components.dart
index d1028b2b9b7e2023274fcaf7e8921665e0295078..a5bf002e7633c6cf7f5087f28575e567fdc3a988 100644
--- a/lib/build/web_components.dart
+++ b/lib/build/web_components.dart
@@ -32,10 +32,14 @@ Asset generateWebComponentsBootstrap(Resolver resolver, Transform transform,
resolver, transform, scriptId, newScriptId,
errorIfNotFound: false, plugins: plugins);
- // Add all seen imports to the document.
+ // Add all seen imports to the document, before the first dart script tag if
+ // it exists.
+ var dartScript =
+ document.head.querySelector('script[type="application/dart"]');
for (var importPath in htmlImportRecorder.importPaths) {
- document.head.append(new dom.Element.tag('link')
- ..attributes = {'rel': 'import', 'href': importPath,});
+ var import = new dom.Element.tag('link')
+ ..attributes = {'rel': 'import', 'href': importPath,};
+ document.head.insertBefore(import, dartScript);
}
return initializeBootstrap;
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698