How to add external web pages without starting extraction in CLI?

quick question in the Angular CLI.

Usually, when I use webpack, I can register external elements in the webpack configuration ( https://webpack.js.org/configuration/externals/ ) for any objects that are stored in the window object. So, if I have window.foo = bar, I can register this as external with a name in my webpack.config.js, and then I can

var x = require ("foo"); (or import * as foo from 'foo' into typescript)

wherever i need

The problem is that the Angular CLI supports the webpack configuration under the black box, and I REALLY don't want to extract from it.

For the full problem that I am facing, I need to take this https://github.com/AzureAD/microsoft-authentication-library-for-js library and use it in my Angular Typescript project. I would like to be able to "import" as MSAL from "msal"; "but if you look at the source code for this library, it doesn’t actually export it as a module, it just saves it in an object window.

Thank!

+4
source share

Source: https://habr.com/ru/post/1680425/


All Articles