Every time I revisit Aurelia I have the same barriers, always around getting up-and-running.
This is an unfortunate thing with the .NET Core landscape having been completely broken and changed several times since its inception, and it has been hard to keep up.
Apart from that, stuff does work at the moment, but the documentation is still a bit scattered on certain topics and not always up-to-date. If you open a GH issue with links to which instructions you followed, and specify exactly which options you used, that would make it easier for us to manage and solve.
It seems there is a problem with the webpack config generated by the aurelia cli. (reminder to self and @huochunpeng - we really need to create automated tests that run all the combinations on CI and try to run the generated apps and warn us if anything is broken…!)
Here’s what I did to get a working ASP.NET Core app (not saying this is the only combo that works, but I like to start with the simplest possible thing and add stuff as I need it):
create a new directory, cd to it
au new --here
[Webpack]> 1
[HTTP/1.1]> 1
[ASP.NET Core]> 2
[TypeScript]> 2
[Default]> 1
[None]> 1
[None]> 1
[No]> 1
[Visual Studio Code]> 1
[Yes]> 1
[Yes, use NPM]> 2
Now, replace the optimization
section in webpack.config.js
with this:
optimization: {
splitChunks: {
chunks: "initial",
cacheGroups: {
default: false,
vendors: false,
aureliaBinding: {
test: /[\\/]node_modules[\\/]aurelia-binding[\\/]/,
name: "vendor.aurelia-binding",
enforce: true,
priority: 28
},
aureliaTemplating: {
test: /[\\/]node_modules[\\/]aurelia-templating[\\/]/,
name: "vendor.aurelia-templating",
enforce: true,
priority: 26
},
aurelia: {
test: /[\\/]node_modules[\\/]aurelia-.*[\\/]/,
name: "vendor.aurelia",
enforce: true,
priority: 20
},
vendors: {
test: /[\\/]node_modules[\\/]/,
name: "vendor",
enforce: true,
priority: 10
},
common: {
name: 'common',
minChunks: 2,
chunks: 'async',
priority: 0,
reuseExistingChunk: true,
enforce: true
}
}
}
},
Again, I’m sure this is not the only thing that works and there’s likely just one small tweak that would be sufficient to get it working, but I’m not the CLI guy so I’m just giving you a working piece I worked on a few months ago.
Now you can run dotnet run
and you should see the app on https://localhost:5001
up and running