| 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 |
| 11 import 'src/build/add_log_injector.dart'; |
| 11 import 'src/build/build_filter.dart'; | 12 import 'src/build/build_filter.dart'; |
| 12 import 'src/build/common.dart'; | 13 import 'src/build/common.dart'; |
| 13 import 'src/build/import_inliner.dart'; | 14 import 'src/build/import_inliner.dart'; |
| 14 import 'src/build/linter.dart'; | 15 import 'src/build/linter.dart'; |
| 16 import 'src/build/log_combiner.dart'; |
| 15 import 'src/build/polyfill_injector.dart'; | 17 import 'src/build/polyfill_injector.dart'; |
| 16 import 'src/build/script_compactor.dart'; | 18 import 'src/build/script_compactor.dart'; |
| 17 | 19 |
| 18 /// The Polymer transformer, which internally runs several phases that will: | 20 /// The Polymer transformer, which internally runs several phases that will: |
| 19 /// * Extract inlined script tags into their separate files | 21 /// * Extract inlined script tags into their separate files |
| 20 /// * Apply the observable transformer on every Dart script. | 22 /// * Apply the observable transformer on every Dart script. |
| 21 /// * Inline imported html files | 23 /// * Inline imported html files |
| 22 /// * Combine scripts from multiple files into a single script tag | 24 /// * Combine scripts from multiple files into a single script tag |
| 23 /// * Inject extra polyfills needed to run on all browsers. | 25 /// * Inject extra polyfills needed to run on all browsers. |
| 24 /// | 26 /// |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 /// comes first (other than linter, if [options.linter] is enabled), which | 73 /// comes first (other than linter, if [options.linter] is enabled), which |
| 72 /// allows the rest of the HTML-processing phases to operate only on HTML that | 74 /// allows the rest of the HTML-processing phases to operate only on HTML that |
| 73 /// is actually imported. | 75 /// is actually imported. |
| 74 List<List<Transformer>> createDeployPhases( | 76 List<List<Transformer>> createDeployPhases( |
| 75 TransformOptions options, {String sdkDir}) { | 77 TransformOptions options, {String sdkDir}) { |
| 76 // TODO(sigmund): this should be done differently. We should lint everything | 78 // TODO(sigmund): this should be done differently. We should lint everything |
| 77 // that is reachable and have the option to lint the rest (similar to how | 79 // that is reachable and have the option to lint the rest (similar to how |
| 78 // dart2js can analyze reachable code or entire libraries). | 80 // dart2js can analyze reachable code or entire libraries). |
| 79 var phases = options.lint ? [[new Linter(options)]] : []; | 81 var phases = options.lint ? [[new Linter(options)]] : []; |
| 80 return phases..addAll([ | 82 return phases..addAll([ |
| 83 [new AddLogInjector(options)], |
| 81 [new ImportInliner(options)], | 84 [new ImportInliner(options)], |
| 82 [new ObservableTransformer()], | 85 [new ObservableTransformer()], |
| 83 [new ScriptCompactor(options, sdkDir: sdkDir)], | 86 [new ScriptCompactor(options, sdkDir: sdkDir)], |
| 84 [new PolyfillInjector(options)], | 87 [new PolyfillInjector(options)], |
| 85 [new BuildFilter(options)] | 88 [new BuildFilter(options)], |
| 89 [new LogCombiner(options)], |
| 86 ]); | 90 ]); |
| 87 } | 91 } |
| OLD | NEW |