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/linter.dart'; |
16 import 'src/build/polyfill_injector.dart'; | 16 import 'src/build/polyfill_injector.dart'; |
17 import 'src/build/script_compactor.dart'; | 17 import 'src/build/script_compactor.dart'; |
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. | 25 /// |
26 * | 26 /// At the end of these phases, this tranformer produces a single entrypoint |
27 * At the end of these phases, this tranformer produces a single entrypoint HTML | 27 /// HTML file with a single Dart script that can later be compiled with dart2js. |
28 * file with a single Dart script that can later be compiled with dart2js. | |
29 */ | |
30 class PolymerTransformerGroup implements TransformerGroup { | 28 class PolymerTransformerGroup implements TransformerGroup { |
31 final Iterable<Iterable> phases; | 29 final Iterable<Iterable> phases; |
32 | 30 |
33 PolymerTransformerGroup(TransformOptions options) | 31 PolymerTransformerGroup(TransformOptions options) |
34 : phases = _createDeployPhases(options); | 32 : phases = _createDeployPhases(options); |
35 | 33 |
36 PolymerTransformerGroup.asPlugin(BarbackSettings settings) | 34 PolymerTransformerGroup.asPlugin(BarbackSettings settings) |
37 : this(_parseSettings(settings)); | 35 : this(_parseSettings(settings)); |
38 } | 36 } |
39 | 37 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return [ | 70 return [ |
73 [new Linter(options)], | 71 [new Linter(options)], |
74 [new InlineCodeExtractor(options)], | 72 [new InlineCodeExtractor(options)], |
75 [new ObservableTransformer()], | 73 [new ObservableTransformer()], |
76 [new ImportInliner(options)], | 74 [new ImportInliner(options)], |
77 [new ScriptCompactor(options)], | 75 [new ScriptCompactor(options)], |
78 [new PolyfillInjector(options)], | 76 [new PolyfillInjector(options)], |
79 [new BuildFilter(options)] | 77 [new BuildFilter(options)] |
80 ]; | 78 ]; |
81 } | 79 } |
OLD | NEW |