Adding Relative URLs Automatically to .angular-cli.json is a simple process that can be easily

Is there a way to automatically have Angular-Cli (Angular-4) append URL's to Styles or Scripts when adding external libraries with npm install --save into .angular-cli.json?

Currently, we have to manually search through the node_modules folder to find the file address and then add it to .angular-cli.json. Is there a more efficient solution?

Thank you,

Best regards,

Shohil Sethia

Answer №1

make sure to specify the --base-href https:// when building the project. for example, run ng build -prod --base-ref http://

It's also advisable to consider using the most recent version of @angular/[email protected] or update to the latest if it's more stable.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with NPM and Vite: Unable to locate "vue" in Framework7 project

I'm running into an unusual issue while working on a simple Framework7 project with vue. After setting up a Framework7 Vue project using the command: framework7 create --ui and installing dependencies with npm i, I encountered the following problem: ...

Troubleshooting Puppeteer installation error with npm on Ubuntu

Having trouble globally installing Puppeteer on Ubuntu 20.04: $ sudo npm install puppeteer -g An error message appeared: npm error code 1 npm error path /usr/local/lib/node_modules/puppeteer npm error command failed npm error command sh -c node install.mj ...

Understanding the fundamentals of TypeScript annotation and node package management

As a newcomer to Typescript, I have grasped the basics but find myself becoming a bit bewildered when it comes to best practices for handling node packages, annotations, and defining types within those packages in my projects. Do I really need to annotate ...

Adding a local image to Firebase Storage in Angular5 / Ionic3

Uploading images is a breeze using the following method (select input file): import { AngularFireStorage } from 'angularfire2/storage'; @Component({ selector: 'app-root', template: '<div>' + '<input c ...

Testing vue-router's useRoute() function in Jest tests on Vue 3

Struggling with creating unit tests using Jest for Vue 3 components that utilize useRoute()? Take a look at the code snippet below: <template> <div :class="{ 'grey-background': !isHomeView }" /> </template> &l ...

I'm facing an issue where I am unable to commit the Angular folder in my project using IntelliJ or SourceTree with

I am currently working on a web app project that includes a folder with a PHP API REST and another folder with Angular files. Strangely, when I try to commit my files to BitBucket, everything gets committed except the files under the Angular folder. Simil ...

typescript warns that an object may be potentially null

interface IRoleAddProps { roles: Array<IRole> } interface IRoleAddState { current: IRole | null } class RoleAdd extends React.Component<IRoleAddProps, IRoleAddState> { state = { current: null, } renderNoneSelect = () ...

Tips for retrieving a data field from the API response in Angular 6

I'm facing an issue where I don't have access to the getAll() method through the web API. When I load my Angular app, I can only see the entire JSON data available over the network at http:localhost:8080/api. All I need is to extract the contract ...

Ways to divide numerical values in Angular?

I need to format a number in the input field which can be either 1000000 or 1000. The desired format is: 1 000 000 or 1 000, respectively. I attempted using a Pipe method but it didn't yield the expected result. What could be causing this issue? {{ ...

how can I update a class of an element when the input box is disabled in angular?

Is there a way in Angular to change the class of a separate element (calendar icon button) when it detects that an input textbox is disabled? I have a disabled input type textbox and I want the class of the calendar icon button to be changed based on its d ...

Revamping every Angular component

Looking for a shortcut to upgrade all my Angular components at once. When checking my Angular version with ng v globally in VS Code terminal, results differ between overall and project directory settings: https://i.stack.imgur.com/2iOJx.png https://i.st ...

Managing state in a large Angular application can be quite challenging

Recently, a unique situation arose within our application that sparked my curiosity. After an extensive search for a solution, I was unable to find a definitive answer. Our application boasts over 600 modules, each with its own set of states and data. I ...

Creating a new function within the moment.js namespace in Typescript

I am attempting to enhance the functionality of the moment.js library by adding a new function that requires a moment() call within its body. Unfortunately, I am struggling to achieve this. Using the latest version of Typescript and moment.js, I have sear ...

The term 'Pick' is typically used to identify a specific type, however, in this particular situation, it appears to be functioning as a value while attempting to expand the Pick

I'm attempting to selectively expose certain properties from an ancestor class on my descendant class. My approach involves using the Pick utility in TypeScript. export class Base { public a; public b; public c; } export class PartialDes ...

Verify the occurrence of an element within an array inside of another array

Here is the scenario: const arr1 = [{id: 1},{id: 2}] const arr2 = [{id: 1},{id: 4},{id: 3}] I need to determine if elements in arr2 are present in arr1 or vice versa. This comparison needs to be done for each element in the array. The expected output sho ...

Tips for utilizing the onClick handler when mapping through items in React

Currently, I am a student learning about react. During the course of working on a project, I encountered a problem that left me with a question. {pages.map((page, idx) => ( <li key={page.page_id} id={`${idx + 1}`} css={CSSCarouselItem}> < ...

The Apache Cordova application developed in Visual Studio 2015 is experiencing technical difficulties

When attempting to run my first Apache Cordova app in Visual Studio 2015 on Windows 8, I encountered an error. Despite trying some solutions, such as cleaning the Cordova cache in the options menu, the error persisted. Below is the error message that needs ...

Setting up the environment for Angular 7 within a TFS build pipeline

I've been attempting to customize the environment in my tfs build pipeline, but it keeps defaulting to the dev environment. Oddly enough, the 'ng serve' command is working perfectly fine. Below are the version details of my application: An ...

Incorporating Vaadin components into an Angular2-seed project

Hi there, I've been encountering an issue while trying to integrate Vaadin elements into my Angular2 seed project. The Vaadin team has recommended that I upgrade the systemjs.config.js file by specifying the path names for Vaadin elements like this: ...

Error: The argument passed to the function must be an Array type. Undefined value was received instead of an array

Looking for some assistance with this coding issue, hoping someone with expertise can lend a hand! (Not my forte) I've written this Typescript code snippet for a basic CloudFunction export const add2list = functions.https.onRequest((req:any , res:any ...