【发布时间】:2017-12-24 11:40:45
【问题描述】:
我正在借助 Angular Quickstart 使用 Angular 2 构建 asp.net 核心应用程序。
由于 Asp.Net 核心应用程序允许 wwwroot 作为文件夹,我将所有依赖项移动到该文件夹,包括节点模块。
Layout.cshtml:
<script src="/node_modules/core-js/client/shim.min.js"></script>
<script src="/node_modules/zone.js/dist/zone.js"></script>
<script src="/node_modules/systemjs/dist/system.src.js"></script>
<script src="~/src/systemjs.config.js"></script>
<script>
System.import('main.js').catch(function (err) { console.error(err); });
</script>
ts.Config.json:
{
"compileOnSave": true,
"compilerOptions": {
"importHelpers": true,
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"removeComments": true,
"outDir": "wwwroot/src"
}
}
现在我面临以下错误:
http://localhost:18929/main.js 404(未找到)
(index):45 Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:18929/main.js
【问题讨论】:
标签: asp.net angular asp.net-core-1.1