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