Is it feasible to utilize ng-packagr to compile a library into a single script file that can be executed on a web browser by importing it as
<script src="bundle.js"></script>
?
For instance, if I have a main.ts
file that contains console.log('hello');
and I wish to create an index.html
file and import this code using
<script src="main.js"></script>
.
Can ng-packagr accomplish this task? It appears that the generated files include esm2020
, fesm2015
, fesm2020
which may not be compatible with all browsers.
Furthermore, I am fine with webpack wrapping the script if necessary.