I am trying to create a new project using Net 5.0, aurelia-cli 2.0.2 and webpack.
This is the first time I’ve used webpack and cannot work out how to configure it so that I can run the server on https://localhost:5001 and the webpack-devserver on the same port.
Previously using requireJs, I could run the server on https://localhost:5001, run ‘au build --watch’ and then type in to the browser https://localhost:5001
and the application would run. However I now just get page not found. If I run https://localhost:5001/swagger - the page comes up correctly.
I just discovered that I need to type https://localhost:5001/dist/index.html
for the app to start. In doing so I get Failed loading required CSS file: styles/app.css
If I comment out in app.html
<require from="./styles/app.css"></require>
the app will load.
I note that it correctly loads
<require from="@fortawesome/fontawesome-pro/css/all.min.css"></require>
<require from="izitoast/dist/css/iziToast.min.css"></require>
When using requireJs I could set a proxy in run.ts
file to:
let serve = gulp.series(
build,
done => {
browserSync({
online: false,
open: CLIOptions.hasFlag("open"),
port: project.platform.port,
logLevel: "silent",
proxy: {
target: "https://localhost:5001"
},
}, function (err, bs) {
if (err) return done(err);
let urls = bs.options.get("urls").toJS();
log(`Application Available At: ${urls.local}`);
log(`BrowserSync Available At: ${urls.ui}`);
done();
});
}
);
This would give what I suppose is the equivalent of hmr?
I also had to remove all references to WebpackMiddleware in Startup
Clearly I don’t understand what I’m doing !!!
At this stage I would be quite happy if I could find the solution to getting the app to run when I type https://localhost:5001
into the browser, and understanding why I’m getting the failed to load app.css error.
I don’t have a problem in manually running dotnet run
and au build --watch
webpack.config.js
and webpack.netcore.config.js
are the default files.