A mimosa module for allowing you to specify lines or blocks of code as features to be enabled or disabled dynamically.
In your app's mimosa-config.js
, define commentDefeature
options on your app instance as such:
commentDefeature: {
features: {
'shiny': false,
'mapping.wgs84': process.env.BUILD_PROFILE !== 'customer1'
}
}
Then you're ready to start decorating your code with feature descriptors.
export default Ember.Component.extend({
tagName: 'span',
/* feature shiny */
shiny: Ember.inject.service(),
/* feature shiny:start */
demonstrateShininess: Ember.observer('model', function () {
this.get('shiny').makeNoise('Totes shiny');
})
/* feature shiny:end */
});
export default Ember.Component.extend({
tagName: 'span',
/* feature shiny */
// shiny: Ember.inject.service(),
/* feature shiny:start */
// demonstrateShininess: Ember.observer('model', function () {
// this.get('shiny').makeNoise('Totes shiny')
// })
/* feature shiny:end */
});
/* feature shiny */
.shiny-one-liner {}
.some-container {
background-color: gold;
/* feature shiny:start */
color: red;
border-color: lime;
/* feature shiny:end */
}
/* feature shiny */
/* .shiny-one-liner {} */
.some-container {
background-color: gold;
/* feature shiny:start */
/* color: red; */
/* border-color: lime; */
/* feature shiny:end */
}
A key-value hash of your features. Defaults to {}
.
An array of file extensions that will be processed. Defaults to ['js', 'hbs', 'css', 'scss']
.
Inspired by the following projects: