The problem with parcel is, that it does not load dependencies at runtime. Dependencies have to be statically parsable at compile time even for dynamic imports
So loading the corresponding .html template automatically from a viewmodel wouldn’t work. Importing it explicitly would work, but requires you to apply the returned template explicitly by using
@template(loadedTemplate). But eventually it does not work as well, because html seems to be treated not as module. On the other hand, if you import the template explicitly, you would be free to use other html dialects as well, but I didn’t test this.
Using an inline template
@view("<template><p>WORKS</p></template>") works. Although dynamically loaded dependencies from the template would again not work. But since june (see blogpost) it is possible to load dependencies as modules, so this is not a showstopper as well.
Bootstrapping has to be done manually as well, because
aurelia-app="src/main" is not picked up as a dependency from parcel. But this a single line of code, again no showstopper.
HMR does not really hot reload. When a module is changed, Parcel executes the changed module and every parent of the changed module. So eventually it executes the bootstrapper, which replaces the stale aurelia app with the updated aurelia app. So your code changes are applied and in effect, but the state of the previous app is lost. There is a
aurelia-hot-module-reload, but I didn’t get it to work with parcel. It seems it is only supposed to be used with webpack. At least only webpack is mentioned in its readme file.
In other words, I have aurelia running with parcel in a POC. Apart from the mentioned restrictions, it works quite well. I try to get something up on github and npm asap. I would be glad to receive some help, because I am not to well versed in the internals of aurelia nor in parcel.