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

Side by Side Diff: packages/polymer_interop/lib/src/build/replace_polymer_js.dart

Issue 2312183003: Removed Polymer from Observatory deps (Closed)
Patch Set: Created 4 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
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4 library polymer_interop.src.build.replace_polymer_js.dart;
5
6 import 'dart:async';
7 import 'package:barback/barback.dart';
8
9 /// Replaces `polymer.min.js` with `polymer.js` in development mode.
10 class ReplacePolymerJsTransformer extends Transformer {
11 BarbackSettings settings;
12
13 ReplacePolymerJsTransformer.asPlugin(this.settings);
14
15 bool isPrimary(AssetId id) {
16 if (settings.mode == BarbackMode.RELEASE) return false;
17 return id.path == 'lib/src/js/polymer.html';
18 }
19
20 Future apply(Transform transform) async {
21 var contents = await transform.primaryInput.readAsString();
22 contents = contents.replaceFirst('polymer.min.js', 'polymer.js');
23 transform
24 .addOutput(new Asset.fromString(transform.primaryInput.id, contents));
25 }
26 }
OLDNEW
« no previous file with comments | « packages/polymer_interop/lib/polymer_interop.dart ('k') | packages/polymer_interop/lib/src/js/AUTHORS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698