
Question:
I created a Visual Studio 2017 ASP.NET Core 2.0 solution by using the SPA Aurelia template. Everything works fine so far but I don't get the configuration (in "boot.ts") to find my "resources/elements" folder (or it's index.ts):
export function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.feature(PLATFORM.moduleName('resources'));
<blockquote>
"Unable to find module with ID: resources/index at WebpackLoader. (aurelia-loader-webpack.js:187)"
</blockquote>The index.ts:
import { FrameworkConfiguration } from 'aurelia-framework';
export function configure(config: FrameworkConfiguration) {
config.globalResources(['./elements/loading-indicator']);
}
The solution structure:
<a href="https://i.stack.imgur.com/qLbyj.png" rel="nofollow"><img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/qLbyj.png" data-original="https://i.stack.imgur.com/qLbyj.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>
Answer1:I had to change
.feature(PLATFORM.moduleName('resources'));
to
.feature(PLATFORM.moduleName('resources/index'));
(<a href="https://github.com/aurelia/webpack-plugin/issues/108" rel="nofollow">https://github.com/aurelia/webpack-plugin/issues/108</a>)
and
import { FrameworkConfiguration } from 'aurelia-framework';
export function configure(config: FrameworkConfiguration) {
config.globalResources([
'./elements/loading-indicator'
]);
}
to
import { FrameworkConfiguration, PLATFORM } from 'aurelia-framework';
export function configure(config: FrameworkConfiguration) {
config.globalResources([
PLATFORM.moduleName('./elements/loading-indicator')
]);
}
and also
@noView([ 'nprogress/nprogress.css' ])
export class LoadingIndicator {
...
}
to
@noView([ PLATFORM.moduleName('nprogress/nprogress.css') ])
export class LoadingIndicator {
...
}
;)