GithubHelp home page GithubHelp logo

Comments (7)

antonybudianto avatar antonybudianto commented on July 19, 2024 1

no, --env=demo will never affect global.ENV (vice versa) since they're totally different.
--env is for node environment, global.ENV is for browser environment,
and browser environment should not be available in production build

from angular-starter.

antonybudianto avatar antonybudianto commented on July 19, 2024 1

you can declare that anywhere before systemjs.conf.js loaded, for example you create env.js with following lines:

(function(global){
global.ENV = 'demo';
})(window);

and load the script before systemjs.conf.js

from angular-starter.

DarkDrim avatar DarkDrim commented on July 19, 2024 1

Thank you, it solved my problem.

from angular-starter.

antonybudianto avatar antonybudianto commented on July 19, 2024

env for gulp tasks should be using --env=demo

but for usage in app, it's in
https://github.com/antonybudianto/angular2-starter/blob/master/src/systemjs.conf.js#L9
and you can override it before that file loaded

from angular-starter.

DarkDrim avatar DarkDrim commented on July 19, 2024

I rungulp serve-dev --env=demo or gulp build --env=demo
But in systemjs.conf file global.ENV == undefined

from angular-starter.

DarkDrim avatar DarkDrim commented on July 19, 2024

Yes, how i can change global.ENV?
I want add "global.ENV = demo". How I can do this?

from angular-starter.

DarkDrim avatar DarkDrim commented on July 19, 2024

I have a different configuration files (a class).
I depending on the environment variable must use different files.
For example, "demo.conf" or "dev.conf"

from angular-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.