Skip to content
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

environment constants #119

Open
agardou opened this issue Jul 24, 2015 · 0 comments
Open

environment constants #119

agardou opened this issue Jul 24, 2015 · 0 comments

Comments

@agardou
Copy link

agardou commented Jul 24, 2015

It should be nice to add some environment configuration in your generator : API URLs, security configuration, ....
I use grunt-ng-constant with ".json" or ".env.js" files in "/config" directory which is really simple and efficient.

You could add some option on app creation ? And maybe command helper to add environnement configuration file ?

Here some sample grunt task :

ngconstant: {
            options: {
                name: 'sampleApp',
                deps: false,
                wrap: '"use strict";\n// DO NOT EDIT THIS FILE, EDIT THE GRUNT TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\n{%= __ngModule %}',
                constants: {
                    version: grunt.file.readJSON('package.json').version
                }
            },
            dev: {
                options: {
                    dest: '/app.constants.js'
                },
                constants: {
                    environnement: 'dev',
                    CommonConstants: grunt.file.readJSON('config/dev.json')
                }
            },
            prod: {
                options: {
                    dest: 'temp/app.constants.js'
                },
                constants: {
                    environnement: 'prod',
                    CommonConstants: grunt.file.readJSON('config/prod.json')
                }
            }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant