Start React with Auth0

This may take a couple of minutes depending on your internet connection to create the whole thing. However, when this tool finishes, issue the following commands to run your react app. This will…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Selective build with Angular 6 and CLI

I’ll assume that you have a basic understanding of Angular CLI and already have a project setup that was generated by the CLI. When we moved from Angular 5 to Angular 6 and the CLI I generated a new project using the CLI and then moved files over (along with the .git folder to maintain history).

So to give context for what this story covers we want to accomplish:

To begin we’ll need two tsconfig files for each ‘selective build.’ One for the application build and one for unit tests. For example if you had 3 domains or ‘selective builds’ : domainA, domainB, domainC then tsconfig-domainA.app.json would look something like:

And tsconfig-domainA.spec.json would look something like:

Repeat this for ‘domainB’ and ‘domainC’. Then in angular.json you can reference these files in the appropriate ‘configurations object:

The VERY important caveat to leveraging tsconfig exclude is that there can be NONE, ZERO, ZILCH references between the modules. If some file in domainB.module imports a file from domainA.module then domainA code will get included despite the tsconfig settings. I learned this the hard way :(

I haven’t mentioned yet the config/domains/domainX.ts files that replaces base.ts. This would be optional but I’m using it as a way to define app level routing and ensure that other ‘domains’ / ‘selective build’ code is not referenced in the build output.

The last piece to connect this is an NPM scripts that look something like:

That’s it! I also setup a Webpack ‘pre-build’ step but that’s a more specialized setup that could be covered in another story. Add a comment if you want to learn more or have related questions.

Add a comment

Related posts:

What should I know about Breast Cancer?

Breast cancer is a disease in which malignant (cancer) cells form in the tissues of the breast. Breast cancer begins when there is uncontrollable growth of cells in the breast. Gradually these cells…

How Content Marketing Can Help Small Businesses

Small businesses have to get creative to compete with larger companies. Content marketing is one strategy that can help you stand out from the competition. Many compelling reasons to implement a…

What is the area of my interest

I am interested to share my drizzly thinks in my head by videos and creativity to show it is already built on me. The interesting more things my desire to not to write every day exercises, it is…