Skip to content

fix(serve): Removes logic looking for config/environment.js in the project root #4057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
41 changes: 1 addition & 40 deletions packages/angular-cli/ember-cli/lib/models/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,6 @@ Project.prototype.isEmberCLIAddon = function() {
return !!this.pkg.keywords && this.pkg.keywords.indexOf('ember-addon') > -1;
};

/**
Returns the path to the configuration.

@private
@method configPath
@return {String} Configuration path
*/
Project.prototype.configPath = function() {
var configPath = 'config';

if (this.pkg['ember-addon'] && this.pkg['ember-addon']['configPath']) {
configPath = this.pkg['ember-addon']['configPath'];
}

return path.join(configPath, 'environment');
};

/**
Loads the configuration for this project and its addons.

Expand All @@ -145,31 +128,9 @@ Project.prototype.configPath = function() {
@return {Object} Merged confiration object
*/
Project.prototype.config = function(env) {
var configPath = this.configPath();

if (existsSync(path.join(this.root, configPath + '.js'))) {
var appConfig = this.require('./' + configPath)(env);
var addonsConfig = this.getAddonsConfig(env, appConfig);

return merge(addonsConfig, appConfig);
} else {
return this.getAddonsConfig(env, {});
}
};

/**
Returns the addons configuration.

@private
@method getAddonsConfig
@param {String} env Environment name
@param {Object} appConfig Application configuration
@return {Object} Merged configuration of all addons
*/
Project.prototype.getAddonsConfig = function(env, appConfig) {
this.initializeAddons();

var initialConfig = merge({}, appConfig);
var initialConfig = {};

return this.addons.reduce(function(config, addon) {
if (addon.config) {
Expand Down