I have aurelia configured with webpack. My webpack config has multiple entries, most of which are not aurelia and some that are (… or should be). aurelia-webpack -plugin is defined as:
new AureliaPlugin({
noWebpackLoader: true,
aureliaApp: undefined
}),
The entry then points to a manual bootstrap entry, where I require the PAL loader:
entry: {
aurelia-entry1: [’./some/app’, require.resolve(‘aurelia-webpack-plugin/runtime/pal-loader-entry’)],
otherEntry: ‘some/other/app’,
other…: ‘yet/another/app’
…
};
Finally the bootstrapping looks like this:
import { AuApp } from ‘./AuApp’;
bootstrap(async (aurelia: Aurelia) => {
aurelia.use
.standardConfiguration()
.router();
await aurelia.start();
await aurelia.setRoot(AuApp, document.getElementsByTagName(“BODY”)[0]);
});
I cannot use the PLATFORM.moduleName here, no matter how i define the module (e.g. relative import absolute etc), it cannot resolve. However the normal import works fine.
The problem is, that as soon as I introduce another app, I can no longer get either app to compile. It fails and says I need to use PLATFORM.moduleName, but if I do that, it cannot resolve.
I have tried different things, like having multiple entries in aurelia-webpack-plugin , but its the same thing where its unable to resolve the modules. I cant figure out how this works and why I’m able to load a single app but not multiple. And most importantly I have no idea how to get the multiple entries to load.