MCPcopy
hub / github.com/ember-cli/ember-cli / constructor

Method constructor

lib/broccoli/ember-app.js:63–161  ·  view source on GitHub ↗

EmberApp is the main class Ember CLI uses to manage the Broccoli trees for your application. It is very tightly integrated with Broccoli and has a `toTree()` method you can use to get the entire tree for your application. Available init options: - storeConfigInMeta, defaults to `true`

(defaults, options)

Source from the content-addressed store, hash-verified

61 @param {Object} [options={}] Configuration options
62 */
63 constructor(defaults, options) {
64 if (arguments.length === 0) {
65 options = {};
66 } else if (arguments.length === 1) {
67 options = defaults;
68 } else {
69 defaultsDeep(options, defaults);
70 }
71
72 this._initProject(options);
73 this.name = options.name || this.project.name();
74
75 this.env = EmberApp.env();
76 this.isProduction = this.env === 'production';
77
78 this.registry = options.registry || p.defaultRegistry(this);
79
80 this._initTestsAndHinting(options);
81 this._initOptions(options);
82 this._initVendorFiles();
83
84 this._styleOutputFiles = {};
85
86 // ensure addon.css always gets concated
87 this._styleOutputFiles[this.options.outputPaths.vendor.css] = [];
88
89 this._scriptOutputFiles = {};
90 this._customTransformsMap = new Map();
91
92 this.otherAssetPaths = [];
93 this.legacyTestFilesToAppend = [];
94 this.vendorTestStaticStyles = [];
95 this._nodeModules = new Map();
96
97 this.trees = this.options.trees;
98
99 this.populateLegacyFiles();
100 this.initializeAddons();
101 this.project.addons.forEach((addon) => (addon.app = this));
102 p.setupRegistry(this);
103 this._importAddonTransforms();
104 this._notifyAddonIncluded();
105
106 this._debugTree = BroccoliDebug.buildDebugCallback('ember-app');
107
108 this._defaultPackager = new DefaultPackager({
109 env: this.env,
110 name: this.name,
111 autoRun: this.options.autoRun,
112 project: this.project,
113 registry: this.registry,
114 sourcemaps: this.options.sourcemaps,
115 minifyCSS: this.options.minifyCSS,
116 areTestsEnabled: this.tests,
117 styleOutputFiles: this._styleOutputFiles,
118 scriptOutputFiles: this._scriptOutputFiles,
119 storeConfigInMeta: this.options.storeConfigInMeta,
120 customTransformsMap: this._customTransformsMap,

Callers

nothing calls this directly

Calls 11

_initProjectMethod · 0.95
_initTestsAndHintingMethod · 0.95
_initOptionsMethod · 0.95
_initVendorFilesMethod · 0.95
populateLegacyFilesMethod · 0.95
initializeAddonsMethod · 0.95
_notifyAddonIncludedMethod · 0.95
envMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected