poeticninja / hapi-assets

Load assets in views based on node environment.
MIT License
16 stars 3 forks source link

Aliasing Environments #3

Open jalcine opened 9 years ago

jalcine commented 9 years ago

For the sake of keeping things DRY, perhaps having the ability to alias environments like the following could help:

server.register({
    register: require('hapi-assets'),
    options: {
        development: {
            js: ['js/one.js', 'js/two.js'],
            css: ['css/one.css', 'css/two.css']
        },
        production: {
            js: ['js/scripts.js'],
            css: ['css/styles.css']
        },
        test: 'development',
        staging: 'production'
    }
}, function (err) {
    if(err){
        console.log('Failed loading plugin hapi-assets');
    }
});
poeticninja commented 9 years ago

Thats a really great idea actually. I would be willing to accept a pull request with tests. :smile:

jalcine commented 9 years ago

Ah, I ended up using Hapi solely as an API server so this fell through for me. I'm still down to contribute though, I'd need a few days.

jalcine commented 7 years ago

Is it okay if I close this? I'm not particularly interested in this functionality anymore.