我从英雄教程https://angular.io/docs/ts/latest/guide/setup.html中克隆了项目。
我想将.js文件分隔到另一个目录,因为现在我将.ts,.js和.js.map文件放在一个目录中。
我尝试按照以下答案解决问题:Separate Angular2 TypeScript files and JavaScript files into different folders, maybe 'dist‘但是在systemjs.config.js和tsconfig.json发生更改后我收到错误:
Failed to load resource: the server responded with a status of 404 (Not Found)
localhost/:18 Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/app/app.module
Error: XHR error (404 Not Found) loading http://localhost:3000/app/app.module
at XMLHttpRequest.wrapFn [as __zone_symbol___onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:1056:39)
at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:424:31)
at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:191:47)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:486:38)
Error loading http://localhost:3000/app/app.module as "./app/app.module" from http://localhost:3000/main.js
at XMLHttpRequest.wrapFn [as __zone_symbol___onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:1056:39)
at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:424:31)
at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:191:47)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:486:38)
Error loading http://localhost:3000/app/app.module as "./app/app.module" from http://localhost:3000/main.js
答案 0 :(得分:2)
添加
"files.exclude": {
"**/*.js.map": true,
"**/*.js": {
"when": "$(basename).ts"
}
},
到您的用户设置