gpt4 book ai didi

angular - 如何使用 webpack 设置 angular 4

转载 作者:太空狗 更新时间:2023-10-29 17:13:23 27 4
gpt4 key购买 nike

当我创建 angular-project(ng new projectname) 时,它会自动构建 inline.bundle.jsmain.bundle.jspolyfills.bundle dist 文件夹中的 .jsstyles.bundle.jsvender.bundle.js。我可以在后端使用 dist/index.js。所以我的问题是“Ng4 自动构建 webpack?”

最佳答案

当您使用 angular-cli 创建 angular 2 项目时,该项目会自动使用 webpack 构建。

不久前,Angular-cli 从 systemjs 更改为 webpack。

如果你想获取 webpack 配置文件,你可以使用 ng eject。

https://github.com/angular/angular-cli/wiki/eject

根据评论编辑:

在你的angular项目中没有对webpack的依赖,因为angular/cli对webpack有依赖并且会为你安装webpack。如果你检查你的 node_modules 文件夹,你会看到 webpack 在那里。

关于angular - 如何使用 webpack 设置 angular 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43744200/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com