# Embed Aurelia in Vue

**URL:** https://discourse.aurelia.io/t/embed-aurelia-in-vue/4903
**Category:** Uncategorized
**Created:** [September 6, 2022, 2:05pm UTC](https://discourse.aurelia.io/t/embed-aurelia-in-vue/4903 "2022-09-06T14:05:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![pbrzosko](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/pbrzosko/32/2340_2.png) [@pbrzosko](https://discourse.aurelia.io/u/pbrzosko)
#### Post date: [September 6, 2022, 2:05pm UTC](https://discourse.aurelia.io/t/embed-aurelia-in-vue/4903/1 "2022-09-06T14:05:07Z")

</div>

Hi,

is it possible to embed Aurelia in Vue. What I would like to do is to take Aurelia app, or even better Aurelia module, and then bootstrap it inside a Vue component to mount it on the component’s HTML element.

How can I make it happen? We have some legacy code in Aurelia, that we would like to embed inside Vue. I have tried couple of approaches with webpack build, but none of them worked. I was able to setup an Aurelia app and Vue app in single-spa framework, but I would like to avoid setting up different servers for different apps. I would rather somehow import Aurelia module into Vue.

Please help 🙂

---

<div class="post-metadata">

### Author: ![pbrzosko](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/pbrzosko/32/2340_2.png) [@pbrzosko](https://discourse.aurelia.io/u/pbrzosko)
#### Post date: [September 6, 2022, 2:06pm UTC](https://discourse.aurelia.io/t/embed-aurelia-in-vue/4903/2 "2022-09-06T14:06:05Z")

</div>

Or maybe it is possible to create an Aurelia library from applicationa and import it in Vue and use Aurelia modules from it?

---

<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: [September 7, 2022, 11:18pm UTC](https://discourse.aurelia.io/t/embed-aurelia-in-vue/4903/3 "2022-09-07T23:18:18Z")

</div>

All Aurelia needs is an application host. So in your Vue component, just need to get a reference to a real element where you want to host the Aurelia application, and start the app on that one. Have you tried it?

---

<div class="post-metadata">

### Author: ![pbrzosko](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/pbrzosko/32/2340_2.png) [@pbrzosko](https://discourse.aurelia.io/u/pbrzosko)
#### Post date: [September 8, 2022, 8:31am UTC](https://discourse.aurelia.io/t/embed-aurelia-in-vue/4903/4 "2022-09-08T08:31:00Z")

</div>

Hi, yes I did.  
I spent a lot of time trying to make webpack compile Vue and Aurelia code together, but it seems to work now. Currently, my Vue component looks like this (single spa inspired):

```auto
async created() {
    const aurelia = Container.instance.get(Aurelia)
    await aurelia.start();
    await aurelia.setRoot(PLATFORM.moduleName('some module'), this.$el);
  },
  unmounted() {
    const aurelia: AureliaInstance = Container.instance.get(Aurelia) as AureliaInstance;
    aurelia.root.view.removeNodes();
    aurelia.root.detached();
    aurelia.root.unbind();
    aurelia.host = null;
    aurelia.hostConfigured = false;
  }

```

And then I configure Aurelia in main.ts:

```auto
bootstrap(async (aurelia: Aurelia) => {
    aurelia.use
        .standardConfiguration()
        .plugin(PLATFORM.moduleName('aurelia-animator-css'))
        .plugin(PLATFORM.moduleName('some module'))
        .plugin(PLATFORM.moduleName('aurelia-dialog'));
});

```

But what I am acutally trying to do, is to have a Vue component, that will display one module, and then another Vue component taht will display another module. Should I somehow requse Aurelia instances there?

---

<div class="post-metadata">

### Author: ![pbrzosko](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/pbrzosko/32/2340_2.png) [@pbrzosko](https://discourse.aurelia.io/u/pbrzosko)
#### Post date: [October 2, 2022, 4:31pm UTC](https://discourse.aurelia.io/t/embed-aurelia-in-vue/4903/5 "2022-10-02T16:31:47Z")

</div>

OK, I have decided to go with single-spa approach. Thank you.
