question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting environment info in customWebpackConfig.

See original GitHub issue

Environment info Is it possible to get the specific environment info in the customWebpackConfig, for example:

  • We run ng build -c staging, the data we got is which we defined in environment.staging.ts
  • We run ng build -c production, the data we got is which we defined in environment.production.ts

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
just-jebcommented, Feb 19, 2020

Ok ok, I know what the problem is. You use index-transform.ts instead of index-transform.js and it is not supported. The trick you did causes webpack builder to register TS compiler for customWebpackConfig (in which TS is supported) and the side-effect is that you can also load your index-transform.ts.
Would you mind opening a feature request to support TS for indexTransform?
PR is also welcome btw, it should be very small.

0reactions
at-vinguyencommented, Feb 21, 2020

In short, we need to improve two things:

  1. Get the target configuration in the custom webpack config (issue already raised by you)
  2. Support TS for index Transform (I will create a new issue for that) BTW, thank you for your time.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass custom environment parameters to @angular-builders ...
Is it possible to do something like this? In the customWebpackConfig file I can read the outputPath from options module.exports = (config, ...
Read more >
Environment Variables - webpack
The webpack command line environment option --env allows you to pass in as many environment variables as you like. Environment variables will be...
Read more >
Learn How to Use Angular Environment Variables ... - YouTube
This video will teach you how to create environmental variables using an angular custom webpack configuration.The goal is to create the ...
Read more >
How To Use Custom webpack Configurations with Angular ...
Learn how to create a custom webpack config inside an Angular project using CLI Builders. This example will reduce the file size of...
Read more >
Adding a Custom webpack Config - Gatsby
Before creating custom webpack configuration, check to see if there's a Gatsby plugin already built that handles your use case in the…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found