带有webpack的Angular 2用于生产环境

时间:2016-12-21 05:43:11

标签: angular webpack

我在Angular 2中有点新功能,并尝试按照Angular official doc设置Angular + webpack,一切都在开发环境中运行正常但是对于生产,我的所有文件都捆绑在特定文件中index.html也是在dist文件夹本身内创建的,因此我应该如何加载dist/index.html

1 个答案:

答案 0 :(得分:0)

正如您所遵循的文档一样,我假设已经安装了webpack-dev-server,您可以使用该dist生成构建后提供webpack-dev-server --content-base dist文件夹文件:

为生产构建运行提供服务:<ScrollView android:layout_width="match_parent" **android:fillViewport="true"** android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_height="wrap_content" ... > <LinearLayout android:layout_height="wrap_content" ... > <LinearLayout android:layout_height="wrap_content" ... > <RelativeLayout android:layout_width="match_parent" **android:layout_height="0dp" android:layout_weight="1"**> <com.google.android.gms.maps.MapView android:layout_width="match_parent" android:layout_height="match_parent" /> <Button ... /> <Button ... /> <Button ... /> </RelativeLayout> </LinearLayout> </ScrollView>

查看webpack dev server文档以获取更多详细信息。

相关问题