UNPKG

1.52 kBJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const auto_import_1 = __importDefault(require("./auto-import"));
7module.exports = {
8 name: 'ember-auto-import',
9 setupPreprocessorRegistry(type, registry) {
10 // we register on our parent registry (so we will process code
11 // from the app or addon that chose to include us) rather than our
12 // own registry (which would cause us to process our own code)
13 if (type !== 'parent') {
14 return;
15 }
16 // This is where we hook our analyzer into the build pipeline so
17 // it will see all the consumer app or addon's javascript
18 registry.add('js', {
19 name: 'ember-auto-import-analyzer',
20 toTree: (tree) => {
21 return auto_import_1.default.lookup(this).analyze(tree, this);
22 }
23 });
24 },
25 included() {
26 let autoImport = auto_import_1.default.lookup(this);
27 this._super.included.apply(this, arguments);
28 if (autoImport.isPrimary(this)) {
29 autoImport.included(this);
30 }
31 },
32 updateFastBootManifest(manifest) {
33 let autoImport = auto_import_1.default.lookup(this);
34 if (autoImport.isPrimary(this)) {
35 autoImport.updateFastBootManifest(manifest);
36 }
37 return manifest;
38 }
39};
40//# sourceMappingURL=index.js.map
\No newline at end of file