Git Product home page Git Product logo

Comments (7)

chihab avatar chihab commented on July 28, 2024 5

It looks that it is now possible to override ESBuild configuration angular/angular-cli#24163

I'll work on that asap in preparation of v17.

Any help would be appreciated.

from ngx-env.

chihab avatar chihab commented on July 28, 2024 2

The @angular-devkit/build-angular:browser-esbuild builder is missing the ability to transform the ESBuild configuration as it's done in @angular-devkit/build-angular:browser
More details in this issue: angular/angular-cli#24163

Note: ESBuild supports a similar transformation https://esbuild.github.io/api/#define, waiting for the final builder interface to support it.

from ngx-env.

luca-peruzzo avatar luca-peruzzo commented on July 28, 2024 2

@luca-peruzzo not really.

I'm still struggling to get the esbuild plugin to work as expected. See angular/angular-cli#26326

I'd be interested to know how you got it to work.

If you have something ready, you can send a PR even if index.html is not supported we can indicate it as a limitation...

@chihab I found a way to modify index.html, I will update the pull request

from ngx-env.

chihab avatar chihab commented on July 28, 2024 2

Many thanks to @luca-peruzzo for his work on the esbuild support.

A new version has been published in alpha, please give it a try.

npx ng add @ngx-env/builder

from ngx-env.

chihab avatar chihab commented on July 28, 2024 1

@luca-peruzzo not really.

I'm still struggling to get the esbuild plugin to work as expected. See angular/angular-cli#26326

I'd be interested to know how you got it to work.

If you have something ready, you can send a PR even if index.html is not supported we can indicate it as a limitation...

from ngx-env.

AmGarera avatar AmGarera commented on July 28, 2024

Awesome thanks for the response! After reading through that issue it makes a ton of sense.

from ngx-env.

luca-peruzzo avatar luca-peruzzo commented on July 28, 2024

It looks that it is now possible to override ESBuild configuration angular/angular-cli#24163

I'll work on that asap in preparation of v17.

Any help would be appreciated.

@chihab I created a fork to implement the necessary changes for angular 17. I was able to use angular's new builder ("@angular-devkit/build-angular:application") and its exposed functionality to add environment variables. However, the process of replacing variables in the index.html (e.g. %NG_APP_ENV%) is causing me problems, because unlike webpack it seems that in esbuild there is no direct way to manipulate the index. Angular itself manipulates the index after running esbuild... Do you have any suggestions for overcoming this problem?

from ngx-env.

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.