1
votes

I've got this first part working already:

https://github.com/BruceL33t/skeleton-esnext-webpack-nested-apps

But since I'm writing a core backend application (with a core aurelia application inside), I have a lot of backend "addon applications" in sibling folders, each with their own aurelia files inside. These files are to be available from the core application, as if they were located inside the core application folder.

It must work the same as the example in the link above, but with the one/app and two/app folders residing outside the entire repo root folder (or just 1 of them) - in a sibling folder.

So.. What I'm trying to achieve is:

  • core backend app
    • core backend aurelia app (skeleton-esnext-webpack-nested-apps)
      • src
        • one
          • app // currently working
  • another-backend app (extension/plugin)
    • public // folder for additional aurelia files
      • two
        • app // this is what I cannot get working

Or the equivalent but simplified:

  • skeleton-esnext-webpack-nested-apps)
    • src/one/app // currently working
  • another-sibling-folder
    • public/two/app // this is what I cannot get working

inside webpack.config.js, under resolve->modules I've tried to add path.resolve(__dirname, '../..'); and it did seem to work a little. But then I got syntax errors in my two/app.js, which was 100% correct (it's like it didnt understand the es6 when the file got moved to a location outside the main application). Thats where I got stuck.

Any ideas?

Edit:

when I add:

modules: [srcDir, 'node_modules', '..'], // we need to get out of the root directory, since the other will are located in a sibling folder

in webpack.config.js

and

main2 = PLATFORM.moduleName('my_other_app_outsite_the_core_app/public/two/app');

it does seem like it's finding the module, but I'm getting a Module build failed: SyntaxError:

enter image description here

1

1 Answers

0
votes

Add the following lines to package.json and it will work:

"aurelia": {
  "build": {
    "resources": [
      "../my_other_app_outsite_the_core_app/public/two/app"
    ]
  }
},

It's also mentioned in the Aurelia documentation.