我使用SPA Aurelia模板创建了Visual Studio 2017 ASP.NET Core 2.0解决方案。到目前为止一切正常但我没有得到配置(在“boot.ts”中)来查找我的“resources / elements”文件夹(或者它的index.ts):
export function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.feature(PLATFORM.moduleName('resources'));
“无法找到ID为:资源/索引的模块 在WebpackLoader。 (Aurelia路上-架webpack.js:187)“
index.ts:
import { FrameworkConfiguration } from 'aurelia-framework';
export function configure(config: FrameworkConfiguration) {
config.globalResources(['./elements/loading-indicator']);
}
解决方案结构:
答案 0 :(得分:1)
我不得不改变
.feature(PLATFORM.moduleName('resources'));
到
.feature(PLATFORM.moduleName('resources/index'));
(https://github.com/aurelia/webpack-plugin/issues/108)
和
import { FrameworkConfiguration } from 'aurelia-framework';
export function configure(config: FrameworkConfiguration) {
config.globalResources([
'./elements/loading-indicator'
]);
}
到
import { FrameworkConfiguration, PLATFORM } from 'aurelia-framework';
export function configure(config: FrameworkConfiguration) {
config.globalResources([
PLATFORM.moduleName('./elements/loading-indicator')
]);
}
以及
@noView([ 'nprogress/nprogress.css' ])
export class LoadingIndicator {
...
}
到
@noView([ PLATFORM.moduleName('nprogress/nprogress.css') ])
export class LoadingIndicator {
...
}
)