我试图在Aurelia \ Aspnetcore \ Typescript项目中使用Aurelia-Form插件。
不幸的是,在使用aurelia-cli构建过程时,我遇到了一个问题,其中aurelia-form组件未正确捆绑。
左边是它应该如何(项目从这里取得https://github.com/SpoonX/swan-example-client)。
我在想我的aurelia.json可能有错误,但我看不到任何可疑的东西。
{
"name": "AuFormsEx",
"type": "project:application",
"platform": {
"id": "aspnetcore",
"displayName": "ASP.NET Core",
"output": "wwwroot\\scripts",
"baseUrl": "scripts"
},
"transpiler": {
"id": "typescript",
"displayName": "TypeScript",
"fileExtension": ".ts",
"dtsSource": [
"./typings/**/*.d.ts",
"./custom_typings/**/*.d.ts"
],
"source": "src\\**\\*.ts"
},
"markupProcessor": {
"id": "none",
"displayName": "None",
"fileExtension": ".html",
"source": "src\\**\\*.html"
},
"cssProcessor": {
"id": "none",
"displayName": "None",
"fileExtension": ".css",
"source": "src\\**\\*.css"
},
"editor": {
"id": "visualstudio",
"displayName": "Visual Studio"
},
"unitTestRunner": {
"id": "none",
"displayName": "None"
},
"paths": {
"root": "src",
"resources": "src\\resources",
"elements": "src\\resources\\elements",
"attributes": "src\\resources\\attributes",
"valueConverters": "src\\resources\\value-converters",
"bindingBehaviors": "src\\resources\\binding-behaviors"
},
"build": {
"targets": [
{
"id": "aspnetcore",
"displayName": "ASP.NET Core",
"output": "wwwroot\\scripts",
"baseUrl": "scripts"
}
],
"loader": {
"type": "require",
"configTarget": "vendor-bundle.js",
"includeBundleMetadataInConfig": "auto",
"plugins": [
{
"name": "text",
"extensions": [
".html",
".css"
],
"stub": true
}
]
},
"options": {
"minify": "stage & prod",
"sourcemaps": "dev & stage"
},
"bundles": [
{
"name": "app-bundle.js",
"source": [
"[**/*.js]",
"**/*.{css,html}"
]
},
{
"name": "vendor-bundle.js",
"prepend": [
"node_modules/bluebird/js/browser/bluebird.core.js",
"wwwroot\\scripts/require.js"
],
"dependencies": [
"aurelia-binding",
"aurelia-bootstrapper",
"aurelia-dependency-injection",
"aurelia-event-aggregator",
"aurelia-framework",
"aurelia-history",
"aurelia-history-browser",
"aurelia-loader",
"aurelia-loader-default",
"aurelia-logging",
"aurelia-logging-console",
"aurelia-metadata",
"aurelia-pal",
"aurelia-pal-browser",
"aurelia-path",
"aurelia-polyfills",
"aurelia-route-recognizer",
"aurelia-router",
"aurelia-task-queue",
"aurelia-templating",
"aurelia-templating-binding",
"aurelia-fetch-client",
"extend",
"aurelia-view-manager",
{
"name": "aurelia-validation",
"path": "../node_modules/aurelia-validation/dist/amd",
"main": "index"
},
{
"name": "validate.js",
"path": "../node_modules/validate.js",
"main": "validate"
},
{
"name": "aurelia-validatejs",
"path": "../node_modules/aurelia-validatejs/dist/amd",
"main": "aurelia-validatejs"
},
{
"name": "aurelia-form",
"path": "../node_modules/aurelia-form/dist/amd",
"main": "aurelia-form",
"resources": [
"component/**/*.html"
]
},
"jquery",
{
"name": "bootstrap",
"path": "../node_modules/bootstrap/dist",
"main": "js/bootstrap.min",
"deps": [ "jquery" ],
"exports": "$",
"resources": [
"css/bootstrap.css"
]
},
{
"name": "text",
"path": "../wwwroot\\scripts/text"
},
{
"name": "aurelia-templating-resources",
"path": "../node_modules/aurelia-templating-resources/dist/amd",
"main": "aurelia-templating-resources"
},
{
"name": "aurelia-templating-router",
"path": "../node_modules/aurelia-templating-router/dist/amd",
"main": "aurelia-templating-router"
},
{
"name": "aurelia-testing",
"path": "../node_modules/aurelia-testing/dist/amd",
"main": "aurelia-testing",
"env": "dev"
}
]
}
]
}
}

有什么想法吗?
答案 0 :(得分:1)
如果您仍在寻找答案,我建议您按照Aurelia-CLI创建它的方式保留config.json,然后从Visual Studio发布到wwwroot。看看我刚刚生成的这个。
const succeedEpic = action$ =>
action$.filter(action => action.type === 'FETCH_WILL_SUCCEED')
.mapTo({ type: 'FETCH_REQUEST' })
.merge(Observable.of({ type: 'FETCH_SUCCESS' }).delay(2000))
您还混合了\\和/ path分隔符,这是不必要的。 我希望这会有所帮助。