从index.html Vs Node Package安装加载脚本(Loading scripts from index.html Vs Node Package install)

编程入门 行业动态 更新时间:2024-10-28 04:18:29
从index.html Vs Node Package安装加载脚本(Loading scripts from index.html Vs Node Package install)

我是angular2的新手,到目前为止我知道有两种方法可以将外部css / js添加到app中。

直接在index.html

可以是CDN或本地文件。

使用npm install <package-name>安装外部npm软件包

注意:仅当包装在NPM中可用时才有效

我正在尝试使用NPM目前无法使用的外部js。 所以,将在index.html添加它

现在,这是一个两部分问题。

在index.html添加外部链接是否会减少angular build --prod --aot的构建时间(无论如何它已经超快)-- angular build --prod --aot ? 通过使用添加外部js / css文件的两种方式中的任何一种,在使用应用程序时是否会对浏览器产生任何性能影响,或者它对性能没有影响?

I am newbie to angular2, so far I know 2 ways of adding external css/js into app.

Directly in index.html

Could be a CDN or local file.

Installing the external npm package using the npm install <package-name>

Note: Works only if the package is available in NPM

I am trying to use an external js which is not available in NPM as of now. So, will be adding it in index.html

Now, this is a two part question.

Does adding external links in index.html reduces the build time(anyway it's already super fast) in angular build --prod --aot? By using any of the two ways of adding external js/css files, will there be any performance impact in browser while using the app or it has no impact on performance?

更多推荐

本文发布于:2023-07-31 15:07:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1344953.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   加载   Node   index   html

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!