| 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/code_extractor.dart'; | 12 import 'src/build/code_extractor.dart'; |
| 13 import 'src/build/common.dart'; | 13 import 'src/build/common.dart'; |
| 14 import 'src/build/import_inliner.dart'; | 14 import 'src/build/import_inliner.dart'; |
| 15 import 'src/build/linter.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 /** | 19 /** |
| 19 * The Polymer transformer, which internally runs several phases that will: | 20 * The Polymer transformer, which internally runs several phases that will: |
| 20 * * Extract inlined script tags into their separate files | 21 * * Extract inlined script tags into their separate files |
| 21 * * Apply the observable transformer on every Dart script. | 22 * * Apply the observable transformer on every Dart script. |
| 22 * * Inline imported html files | 23 * * Inline imported html files |
| 23 * * Combine scripts from multiple files into a single script tag | 24 * * Combine scripts from multiple files into a single script tag |
| 24 * * Inject extra polyfills needed to run on all browsers. | 25 * * Inject extra polyfills needed to run on all browsers. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 error = true; | 63 error = true; |
| 63 } | 64 } |
| 64 if (error) { | 65 if (error) { |
| 65 print('Invalid value for "entry_points" in the polymer transformer.'); | 66 print('Invalid value for "entry_points" in the polymer transformer.'); |
| 66 } | 67 } |
| 67 return entryPoints; | 68 return entryPoints; |
| 68 } | 69 } |
| 69 | 70 |
| 70 List<List<Transformer>> _createDeployPhases(TransformOptions options) { | 71 List<List<Transformer>> _createDeployPhases(TransformOptions options) { |
| 71 return [ | 72 return [ |
| 73 [new Linter(options)], |
| 72 [new InlineCodeExtractor(options)], | 74 [new InlineCodeExtractor(options)], |
| 73 [new ObservableTransformer()], | 75 [new ObservableTransformer()], |
| 74 [new ImportInliner(options)], | 76 [new ImportInliner(options)], |
| 75 [new ScriptCompactor(options)], | 77 [new ScriptCompactor(options)], |
| 76 [new PolyfillInjector(options)], | 78 [new PolyfillInjector(options)], |
| 77 [new BuildFilter(options)] | 79 [new BuildFilter(options)] |
| 78 ]; | 80 ]; |
| 79 } | 81 } |
| OLD | NEW |