0

Can I use ng-packagr to build library with one script file that can run on the browser in the html by import as <script src="bundle.js"></script>?

For example I have main.ts that do console.log('hello'); and I want to create index.html and import this code: <script src="main.js"></script>.

Is it possible to do that with ng-packagr? because I can see that I generate files: esm2020,fesm2015, fesm2020 and those types are not compatibility with all browsers

And I don't care if the script is wrapped by webpack

Jon Sud
  • 10,211
  • 17
  • 76
  • 174

1 Answers1

1

No, ng-packagr is meant to be used to build angular libraries, not standalone libraries.

Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134