【发布时间】:2017-01-07 20:56:42
【问题描述】:
这是我的第一个 angular2 项目制作。 我使用了这个网站的这个答案。 带有 Angular CLI 1.0.0-beta.24 的 2.4.x FINAL (TypeScript)
一次性设置
npm install -g angular-cli
ng init 来自 projectFolder,如果它是现有应用程序
ng new projectFolder 如果它是一个新应用程序。
捆绑步骤
ng build --prod --aot(目录为projectFolder时在命令行中运行)
标记 prod bundle for production 和标记 aot 启用提前编译,也称为离线编译。
bundle 默认生成到 projectFolder/dist/
输出
dist/main.[hash].bundle.js Your application bundled [ size: 13 KB for new Angular CLI application empty, ~3 KB compressed].
dist/vendor.[hash].bundle.js Your dependencies (@angular, RxJS...) bundled [ size: 437 KB for new Angular CLI application empty, 98 KB compressed].
dist/index.html entry point of your application.
dist/inline.js webpack loader
dist/style.[hash].bundle.css the style definitions
dist/assetsresources copied from projectFolder/src/assets
dist/*.[hash].bundle.map the SourceMaps corresponding to the previous files (it is not required for a production deployment)
但是当我单击 dist/index.html 时,我只收到加载...而没有其他内容。 我如何才能收到正式版?
【问题讨论】:
-
你是双击index.html打开项目吗? :O
-
如果我看到加载...,似乎我双击了
-
chrome 控制台有什么错误吗?
-
双击??... :-(
-
我在 node.js 命令提示符中做,没有错误信息
标签: angular