【发布时间】:2019-04-06 12:47:10
【问题描述】:
我有一个 angular4 + MVC 项目。
我生成了一个 dist 文件夹
通过 cli 中的ng build --prod 命令进行角度分析。
我想删除 node 模块,并且只签入这些 dist 文件以进行生产。
我的问题是如何使用/dist 文件夹而不是/node 模块 来开始执行。
目前我正在使用我的 layout.cshtml(in mvc) 中的 system.import() 来导入 angular 的应用程序模块。
<script>
System.import('app/main.js').catch(function (err) { console.error(err); });
systemjs.config 文件中的内容应该是什么,因为我的目的是消除节点模块,目前** systemjs.config ** 指向打开节点模块文件夹。
(function (global) {System.config({
paths: {
'npm:': 'node_modules/'
},
map: {
'app': 'app',
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
等等。等等
任何帮助将不胜感激。
【问题讨论】:
-
本指南帮助了我:linkedin.com/pulse/…
-
正是哈里尼。就是这样。您可以将其发布为答案:)
标签: asp.net-mvc angular deployment systemjs