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.

[PR WELCOME] Set language level for library sources (es5, es6, es7, dom, webworker, ...)

See original GitHub issue

Type of Issue

  • Bug Report
  • Feature Request

Description

I have made an application using a custom component library that I have implemented, and now i wanted to use ng-packagr to externalize my custom component library. The application was created by angular-cli, and i have followed the tutorial of Nikolas LeBlanc and the structure shown in the ng-packaged project.

For some reasons i have used in development es7 features like includes on arrays and padStart on strings. With the angular-cli builds including polyfills of core-js everything was working fine but the ng-packagr build gave me errors like this

Property 'includes' does not exist on type 'any[]'.

I have tried to include them as externals and import them in the components that required the functions but still have theses errors.

So, how can i add polyfills functions on the build ?

Version Information

ng-packagr: v1.3.0
node: v7.10.0
@angular: v4.1.3
rxjs: v5.4.2
zone.js: v0.8.14
core-js: v2.4.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
DavidParks8commented, Oct 11, 2017

Why duplicate the lib config in ng-package.json and tsconfig.json? It should be possible to search for and read the developer’s tsconfig.json dynamically to determine what libs should be included. This could be accompanied by a field to specify a custom tsconfig file such as:

{
  "tsconfig": "./../tsconfig.app.json"
}

It would also be nice to dynamically search .angular-cli.json for the tsconfig.

1reaction
fr0commented, Dec 14, 2017

What is the workaround for this? If there is no workaround, I can’t use ng-packagr until it is implemented.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ECMAScript 2017 Language Specification | Hacker News
Javascript's language level string implementation is something like UCS-2 with the addition of surrogate pairs being allowed, but counted as ...
Read more >
Shadow CLJS User's Guide
With this setting, the shadow-cljs command will use lein to launch the JVM, ignoring any :source-paths and :dependencies in shadow-cljs.edn ...
Read more >
Using Web Workers - Web APIs - MDN Web Docs
You can run whatever code you like inside the worker thread, with some exceptions. For example, you can't directly manipulate the DOM from ......
Read more >
ES5 to ESNext — here's every feature added to JavaScript ...
Introduction to ECMAScript. Whenever you read about JavaScript you'll inevitably see one of these terms: ES3, ES5, ES6, ES7, ES8, ES2015, ES2016 ...
Read more >
How to create typescript library with webworkers using worker ...
js' , which would output a file for every file in your source folder, all on the same level in your _bundles folder....
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