且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我还可以在哪里声明 angular-cli 中包含的脚本?

更新时间:2023-09-30 10:27:28

如果您希望 cli 在单独的包中输出脚本,您可以使用 global-scripts 像:

If you want cli to output the script in a separate bundle you can use global-scripts like:

"scripts": [
    { "input": "../node_modules/module-name", "output": "module-custom-name", "lazy": true}
],

当您指定 "lazy": true cli 将创建一个单独的文件,该文件将仅包含您要有条件加载的模块.

When you specify "lazy": true cli will create a separate file that will contain just your module you want to load conditionally.