| OLD | NEW |
| 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 /// Transfomer used for pub-serve and pub-deploy. | 5 /// Transfomer used for pub-serve and pub-deploy. |
| 6 library polymer.transformer; | 6 library polymer.transformer; |
| 7 | 7 |
| 8 import 'package:barback/barback.dart'; | 8 import 'package:barback/barback.dart'; |
| 9 import 'package:observe/transformer.dart'; | 9 import 'package:observe/transformer.dart'; |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } else { | 59 } else { |
| 60 error = true; | 60 error = true; |
| 61 } | 61 } |
| 62 if (error) { | 62 if (error) { |
| 63 print('Invalid value for "entry_points" in the polymer transformer.'); | 63 print('Invalid value for "entry_points" in the polymer transformer.'); |
| 64 } | 64 } |
| 65 return entryPoints; | 65 return entryPoints; |
| 66 } | 66 } |
| 67 | 67 |
| 68 /// Create deploy phases for Polymer. Note that inlining HTML Imports | 68 /// Create deploy phases for Polymer. Note that inlining HTML Imports |
| 69 /// comes first (other than linter), which allows the rest of the | 69 /// comes first (other than linter, if [options.linter] is enabled), which |
| 70 /// HTML-processing phases to operate only on HTML that is actually imported. | 70 /// allows the rest of the HTML-processing phases to operate only on HTML that |
| 71 /// is actually imported. |
| 71 List<List<Transformer>> _createDeployPhases(TransformOptions options) { | 72 List<List<Transformer>> _createDeployPhases(TransformOptions options) { |
| 72 return [ | 73 var phases = options.lint ? [[new Linter(options)]] : []; |
| 73 [new Linter(options)], | 74 return phases..addAll([ |
| 74 [new ImportInliner(options)], | 75 [new ImportInliner(options)], |
| 75 [new ObservableTransformer()], | 76 [new ObservableTransformer()], |
| 76 [new ScriptCompactor(options)], | 77 [new ScriptCompactor(options)], |
| 77 [new PolyfillInjector(options)], | 78 [new PolyfillInjector(options)], |
| 78 [new BuildFilter(options)] | 79 [new BuildFilter(options)] |
| 79 ]; | 80 ]); |
| 80 } | 81 } |
| OLD | NEW |