1 | import AutoImport from './auto-import';
|
2 | import { Tree } from 'broccoli-plugin';
|
3 |
|
4 | module.exports = {
|
5 | name: 'ember-auto-import',
|
6 |
|
7 | setupPreprocessorRegistry(type: string, registry: any) {
|
8 |
|
9 |
|
10 |
|
11 | if (type !== 'parent') {
|
12 | return;
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 | registry.add('js', {
|
18 | name: 'ember-auto-import-analyzer',
|
19 | toTree: (tree: Tree) => {
|
20 | return AutoImport.lookup(this).analyze(tree, this);
|
21 | }
|
22 | });
|
23 | },
|
24 |
|
25 | included() {
|
26 | let autoImport = AutoImport.lookup(this);
|
27 | this._super.included.apply(this, arguments);
|
28 | if (autoImport.isPrimary(this)) {
|
29 | autoImport.included(this);
|
30 | }
|
31 | },
|
32 |
|
33 | updateFastBootManifest(manifest: { vendorFiles: string[] }) {
|
34 | let autoImport = AutoImport.lookup(this);
|
35 | if (autoImport.isPrimary(this)) {
|
36 | autoImport.updateFastBootManifest(manifest);
|
37 | }
|
38 | return manifest;
|
39 | }
|
40 | };
|