从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 NPMI 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?更多推荐
发布评论