在/config/environment.js中
/* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'bumbox',
podModulePrefix: 'bumbox/pods',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
}
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
}
};
if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
}
if (environment === 'test') {
// Testem prefers this...
ENV.baseURL = '/';
ENV.locationType = 'none';
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = '#ember-testing';
}
ENV['ember-simple-auth'] = {
authenticationRoute: 'index',
routeAfterAuthentication: 'protected',
routeIfAlreadyAuthenticated: 'protected'
};
return ENV;
};我有一些属性需要添加到ENV对象中,但我宁愿将这些属性存储在一个单独的.gitignore'd文件中,这样我就不会将它们发布到github上,比如/config/protected.js。
发布于 2016-08-16 13:55:58
https://github.com/fivetanley/ember-cli-dotenv项目就是您正在寻找的项目。
甚至有一段关于如何设置和使用ember的视频也会播放使用ember-cli-dotenv -cli-dotenv的视频
https://stackoverflow.com/questions/38967309
复制相似问题