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'; | |
13 import 'src/build/common.dart'; | 12 import 'src/build/common.dart'; |
14 import 'src/build/import_inliner.dart'; | 13 import 'src/build/import_inliner.dart'; |
15 import 'src/build/linter.dart'; | 14 import 'src/build/linter.dart'; |
16 import 'src/build/polyfill_injector.dart'; | 15 import 'src/build/polyfill_injector.dart'; |
17 import 'src/build/script_compactor.dart'; | 16 import 'src/build/script_compactor.dart'; |
18 | 17 |
19 /// The Polymer transformer, which internally runs several phases that will: | 18 /// The Polymer transformer, which internally runs several phases that will: |
20 /// * Extract inlined script tags into their separate files | 19 /// * Extract inlined script tags into their separate files |
21 /// * Apply the observable transformer on every Dart script. | 20 /// * Apply the observable transformer on every Dart script. |
22 /// * Inline imported html files | 21 /// * Inline imported html files |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 error = false; | 58 error = false; |
60 } else { | 59 } else { |
61 error = true; | 60 error = true; |
62 } | 61 } |
63 if (error) { | 62 if (error) { |
64 print('Invalid value for "entry_points" in the polymer transformer.'); | 63 print('Invalid value for "entry_points" in the polymer transformer.'); |
65 } | 64 } |
66 return entryPoints; | 65 return entryPoints; |
67 } | 66 } |
68 | 67 |
| 68 /// Create deploy phases for Polymer. Note that inlining HTML Imports |
| 69 /// comes first (other than linter), which allows the rest of the |
| 70 /// HTML-processing phases to operate only on HTML that is actually imported. |
69 List<List<Transformer>> _createDeployPhases(TransformOptions options) { | 71 List<List<Transformer>> _createDeployPhases(TransformOptions options) { |
70 return [ | 72 return [ |
71 [new Linter(options)], | 73 [new Linter(options)], |
72 [new InlineCodeExtractor(options)], | 74 [new ImportInliner(options)], |
73 [new ObservableTransformer()], | 75 [new ObservableTransformer()], |
74 [new ImportInliner(options)], | |
75 [new ScriptCompactor(options)], | 76 [new ScriptCompactor(options)], |
76 [new PolyfillInjector(options)], | 77 [new PolyfillInjector(options)], |
77 [new BuildFilter(options)] | 78 [new BuildFilter(options)] |
78 ]; | 79 ]; |
79 } | 80 } |
OLD | NEW |