我正在学习Angular 4,并计划在本周末创建一个应用程序。Angular 4 node_modules
node_modules
是极大的相。 217 MB的JavaScript框架和node_modules下的700多个子目录!现在
,我也看看生成的HTML,它似乎并没有引用node_modules
。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MyApp</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
<script type="text/javascript" src="inline.bundle.js"></script>
<script type="text/javascript" src="polyfills.bundle.js"></script>
<script type="text/javascript" src="styles.bundle.js"></script>
<script type="text/javascript" src="vendor.bundle.js"></script>
<script type="text/javascript" src="main.bundle.js"></script>
</body>
</html>
问题:我不能部署node_modules吗?角4将仍然正常工作?
当你准备好运行你使用'NG建立--prod',然后复制你的'dist'文件夹的内容您的生产版本。 –
@ Z.Bagley尼斯...我只是试过这个,它发现了一个不错的捆绑JS文件,小于1MB。 –
紧凑,编码和多浏览器有效。很少有框架可以与Angular竞争;) –