What is the best way to convert Angular libraries to ES2016 format?

I have made the decision to completely stop supporting outdated browsers and discontinue support for ES5 compilation/polyfills.

Currently, my Angular project code is compiled with approximately 85% coverage as shown below:

"compilerOptions": {
    "target": "es2016",
    "module": "es2020",
    "lib": [
        "es2019",
        "dom"

These options dictate how the project's code behaves.

However, it is worth noting that Angular libraries are compiled to ES2015.

The question remains: How can we compile our project's VENDOR packages to ES2016/17/18/19/20?

UPDATE: Find the answer on stackoverflow.com/a/68294105/1440240.

Answer №1

As indicated in a discussion on Stack Overflow about using ES6 as the TypeScript target compiler option for AngularJS or Angular2 source

It appears that setting

"target": "es6"
should accomplish the task at hand.

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

Exploring the possibilities of developing WebComponents within Angular using TypeScript

My Angular application was originally created using the default method with ng new project-name". However, for performance reasons, I had to incorporate single standard WebComponents. The JavaScript code associated with these components is stored in a ...

Challenges with integrating a Bootstrap 4 table into a card component

Here is a problem I am facing. It seems that the table inside the card is not displaying correctly. I want the table to be centered or at least eliminate the blank space that is currently showing. Here is my code (using Angular 6): <div class="row ...

Implementing routing for page navigation within an angular tree structure

Can someone assist me with integrating a route into an angular tree structure? Here is the HTML code snippet: <mat-tree [dataSource]="dataSource" class="tree-container" [treeControl]="treeControl"> <mat-tree-node class="btnLinks" *matTreeN ...

Simulating a PubSub publish functionality

I have been trying to follow the instructions provided in this guide on mocking new Function() with Jest to mock PubSub, but unfortunately I am facing some issues. jest.mock('@google-cloud/pubsub', () => jest.fn()) ... const topic = jest.fn( ...

Ways to EXPAND styled components from imported components

After researching the styled components documentation, I discovered that in version 4+, the "as" prop should allow me to extend my imported component. However, I am having trouble getting it to work. COMPONENT: type Options = { margin: strin ...

The routeLink feature is unable to display the URL dynamically

https://i.sstatic.net/iD53V.png <table class="table"> <thead> <tr> <th>Name</th> <th>Price</th> <th></th> </tr> </thead> ...

Implement the fastifySession Middleware within NestJS by incorporating it into the MiddlewareConsumer within the AppModule

I have a Nestjs application running with Fastify. My goal is to implement the fastifySession middleware using the MiddlewareConsumer in Nestjs. Typically, the configuration looks like this: configure(consumer: MiddlewareConsumer) { consumer .appl ...

Typescript: Unfiltering a string array

Seeking assistance with TypeScript syntax as a beginner. I'm struggling to refactor this code in order to retrieve the full list of serviceBranches. Currently, there is filtering and mapping resulting in only one serviceBranch being returned from our ...

Issue with Moment.js: inability to append hours and minutes to a designated time

I have a starting time and I need to add an ending time to it. For example: start=19:09 end=00:51 // 0 hours and 51 minutes I want to add the 51 minutes to the 19:09 to make it 20:00. I've attempted several different methods as shown below, but none ...

Troubleshooting: Facing the "jspdf__WEBPACK_IMPORTED_MODULE_2__.jsPDF is not a constructor" error while trying to utilize jsPDF in Angular 7?

I'm currently facing an issue with integrating jsPDF into my Angular 7.1.3 project. Here are the relevant sections from my package.json file: "dependencies": { "@angular/animations": "~7.1.0", "@angular/common": "~7.1.0", "@angular/compi ...

Exploring the Potential of Angular Framework in Combination with Microsoft Analysis

Currently, I am working with SQL Server databases and an Analysis Services layer to access the data. My first attempt was to use Power BI to create a dashboard, but I am not satisfied with how it looks, especially on an iPad, and I find it a bit slow. I ...

Developing web parts with Angular 2 for SharePoint 2013

Seeking advice on how to create a web part for SharePoint 2013 farm solution utilizing WCF custom Rest Services to retrieve data from the content database using server object model. I also aim to incorporate Angular 2 to consume these services within the ...

Obtaining the value of SCOPE_IDENTITY to be used in an Angular application

Having trouble getting the ID of the newly inserted table row to use in my Angular application. Any suggestions on how to pass it while posting? Can't quite figure it out. public string Post(Profile profile) { try { string ...

Effortless loading with tab navigation in routers

Encountering an issue with router navigation and lazy loaded modules. When lazy loading is removed, everything works fine. Here is my setup specifically for lazy loaded modules: In the app.template file, I have the main router-outlet defined. The root ap ...

Using TypeScript to Implement Content Security Policy Nonce

I encountered an issue with my TypeScript Express project while attempting to implement a CSP Nonce using Helmet. app.use(helmet.contentSecurityPolicy({ useDefaults: true, directives: { scriptSrc: ["'self'", (req, res) = ...

What is the best way to trigger an event from a child component to a parent component in

parent.component.ts public test(){ //some code..... } parent.component.html <app-child (eventfire)="test($event)"></app-child> In this scenario, the child component button is displayed within the parent component. However, there i ...

Angular repeatedly displays user information

I am a beginner in the world of programming, teaching myself as I go along. Despite searching through numerous websites, I have struggled to find a solution to a persistent issue in my initial app while trying to grasp some fundamental concepts. Within Fi ...

A guide on utilizing portals in Next.js to move a child element beyond its direct parent container

Current Setup Wrapper export const ContainerComponent = () => { return (<ChildComponent/>); } Child Component export const ChildComponent = () => { return ReactDOM.createPortal( <aside> <div>{"I am a c ...

Basic exam but located in a place that is not valid

Here is a test I am working on: // import {by, element, browser} from "protractor"; describe('intro', () => { beforeEach(() => { browser.get(''); }); it('should have multiple pages', () => { let buttonOn ...

Guide on setting up redux store from server component using next.js and app router

I'm currently working with Next.js 13, React, and Redux to handle state management. My main objective is to fetch initial data on the server side and present it on the client side. Although I assumed this would be a typical approach with Redux and Ne ...