chihab / dotenv-run

Seamlessly load environment variables. Supports cli, esbuild, rollup, vite, webpack, angular. ESM and Monorepos.
238 stars 17 forks source link

Add v17 support #62

Closed luca-peruzzo closed 9 months ago

luca-peruzzo commented 9 months ago

@chihab As I wrote in the comment, I could not find a way to use variables in the index.html. refers to #29

chihab commented 9 months ago

Thanks @luca-peruzzo for this PR. I'll have a look at is asap.

chihab commented 9 months ago

The PR is 👌🏼.

Few things to improve:

I'd suggest that you remove the ngx-env-demo and rename ngx-env-v17-demo to ngx-env-demo so the GH action remains the same then see how it goes.

Thanks again :)

luca-peruzzo commented 9 months ago

@chihab I imported the updated plugin as requested. I also performed a refactor of some functions that were used in several places by adding them to the utils folder (let me know if it is ok for you). For the generation of the index.html when running ng build, do you want synchronous generation (as it is now with writeFileSync) or do you prefer to use asynchronous generation? With the asynchronous one, we could notify the user of the start and end of the variables replacement

luca-peruzzo commented 9 months ago

@chihab for the error in 'npm run test', a devDependency is missing in the builder folder, because apparently karma is needed to run karma builder. If I add it, there is another error with the angular built-in source map plugin (not sure why). Adding sourceMap false in angular.json in the test configuration solves the problem. do you want me to release this fix?

luca-peruzzo commented 9 months ago

@chihab CI fixed.

I've update nx to angular 17 and fixed the schematic. N.B. I have to add @ts-ignore in env.d.ts template

JeffreyArt1 commented 9 months ago

❤️