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

Side by Side Diff: pkg/polymer/lib/src/build/polyfill_injector.dart

Issue 589563002: Add support for not including platform.js in build output (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/lib/src/build/common.dart ('k') | pkg/polymer/lib/transformer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Includes any additional polyfills that may needed by the deployed app. 5 /// Includes any additional polyfills that may needed by the deployed app.
6 library polymer.src.build.polyfill_injector; 6 library polymer.src.build.polyfill_injector;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 9
10 import 'package:barback/barback.dart'; 10 import 'package:barback/barback.dart';
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 _addScriptFirst(urlSegment) { 95 _addScriptFirst(urlSegment) {
96 document.head.nodes.insert(0, parseFragment( 96 document.head.nodes.insert(0, parseFragment(
97 '<script src="packages/$urlSegment"></script>\n')); 97 '<script src="packages/$urlSegment"></script>\n'));
98 } 98 }
99 99
100 var suffix = options.releaseMode ? '.js' : '.concat.js'; 100 var suffix = options.releaseMode ? '.js' : '.concat.js';
101 if (!dartSupportFound) _addScriptFirst('web_components/dart_support.js'); 101 if (!dartSupportFound) _addScriptFirst('web_components/dart_support.js');
102 // platform.js should come before all other scripts. 102 // platform.js should come before all other scripts.
103 if (!platformJsFound) _addScriptFirst('web_components/platform$suffix'); 103 if (!platformJsFound && options.injectPlatformJs) {
104 _addScriptFirst('web_components/platform$suffix');
105 }
104 106
105 transform.addOutput( 107 transform.addOutput(
106 new Asset.fromString(transform.primaryInput.id, document.outerHtml)); 108 new Asset.fromString(transform.primaryInput.id, document.outerHtml));
107 }); 109 });
108 } 110 }
109 } 111 }
110 112
111 final _platformJS = new RegExp(r'platform.*\.js', caseSensitive: false); 113 final _platformJS = new RegExp(r'platform.*\.js', caseSensitive: false);
112 final _dartSupportJS = new RegExp(r'dart_support.js', caseSensitive: false); 114 final _dartSupportJS = new RegExp(r'dart_support.js', caseSensitive: false);
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/build/common.dart ('k') | pkg/polymer/lib/transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698