# Aurelia webpack

**URL:** <https://discourse.aurelia.io/t/aurelia-webpack/3409>\
**Category:** Help Requests\
**Created:** [April 20, 2020, 12:51pm UTC](https://discourse.aurelia.io/t/aurelia-webpack/3409 "2020-04-20T12:51:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrl](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@jrl](https://discourse.aurelia.io/u/jrl)\
**Post date:** [April 20, 2020, 12:51pm UTC](https://discourse.aurelia.io/t/aurelia-webpack/3409/1 "2020-04-20T12:51:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [April 20, 2020, 10:43pm UTC](https://discourse.aurelia.io/t/aurelia-webpack/3409/2 "2020-04-20T22:43:22Z")

</div>

When you do

```auto
import { AuApp } from ‘./AuApp’;
bootstrap(async (aurelia: Aurelia) => {
aurelia.use
.standardConfiguration()
.router();
await aurelia.start();
await aurelia.setRoot(AuApp, document.getElementsByTagName(“BODY”)[0]);
});

```

You are using static resource convention. This probably is you saw something not working. May I see the content of `AuApp`?

And also, did you mean it cannot work when you do:

```auto
await aurelia.setRoot(PLATFORM.moduleName('AuApp'), document.body)

```

(notice no `./` at the start).

=====

And if you wanna go manual and want to control everything 100%:

```auto
import 'aurelia-polyfills';
import { initialize } from 'aurelia-pal-browser';
import { Aurelia } from 'aurelia-framework';

initialize();

(async () => {
  const aurelia = new Aurelia();
  aurelia.use
    .standardConfiguration()
    .developmentLogging()

  await aurelia.start();
  await aurelia.setRoot(PLATFORM.moduleName('AuApp'), document.body);
})();

```
