* Add an addon to this object's `dependencies` list. The engine's addon files will be written in * this object's `node_modules/ ` directory when this object is written out. * * @param {String} name name of the engine * @param {String} version version of the engine, defaults to
(name, version = '0.0.0', options = { allowCachingPerBundle: false, enableLazyLoading: false })
| 242 | * @returns {FixturifyProject} the newly-created engine addon |
| 243 | */ |
| 244 | addEngine(name, version = '0.0.0', options = { allowCachingPerBundle: false, enableLazyLoading: false }) { |
| 245 | const callback = (engine) => { |
| 246 | engine.pkg.keywords.push('ember-engine'); |
| 247 | |
| 248 | // call original callback if it exists |
| 249 | if (typeof options.callback === 'function') { |
| 250 | options.callback(engine); |
| 251 | } |
| 252 | }; |
| 253 | |
| 254 | if (options.enableLazyLoading) { |
| 255 | return this.addAddon(name, version, { |
| 256 | ...options, |
| 257 | additionalContent: 'lazyLoading: { enabled: true },', |
| 258 | callback, |
| 259 | }); |
| 260 | } |
| 261 | |
| 262 | return this.addAddon(name, version, { ...options, callback }); |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * Add an in-repo addon to this object. The addon files will be written in |
no test coverage detected