-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(javascriptservices): update for .net core 2.0 #741
Conversation
Some notes:
Looking at the Aurelia template on the JavaScriptServices repository they have an additional step to check and run webpack. In the current cli it is just has a step for publish but this also has an unnecessary call to webapack.vendor.config that doesn't exist. Happy to fix these issues as well if needed? |
Awesome, thanks a lot! This is a great contribution. Yes, please make any improvements you would like to make. The one failing test is correct, you can ignore it. I see that you've removed the Configuration setup, does that mean that appsettings.json no longer will work? When you're done, please make sure that the commits use the message format. Examples can be found here. |
Would it still be able to detect changes? Is there any setup possible that wouldn't require us to do |
The configuration changed in .net core 2 and is moved to
Yes, It should just be automatic so when you run dotnet run the build is produced and monitored for changes. au would still do this in the background as a pre-build step triggered by dotnet. |
I almost had this working yesterday but seemed to have hit the dreaded webpack rebuild loop. |
I wonder what is different in our setup as opposed to JavascriptServices that we need to do a build initially. I'd like to stay as close to the javascriptservices setup as possible. If you could look into this then that would be a big help |
The webpack build was broken with .net core 2.0 The SpaServices middleware is incompatible with the cli webpack config This adds a config file for webpack that fixes it and was added to the new project build. Realtes to issues aurelia#734 and aurelia#701, clean-webpack-plugin needs to be installed otherwise webpack gets stuck in a rebuilding loop see webpack/watchpack#25 and referenced issues
It was my mistake and it was only an initial build for production build that triggered webpack from the csproj. |
Any updates on getting this merged in? I pulled in the changes, and they look good so far. |
I aim to take a look at PR's in the next week or so |
Great work, thank you @grufffta. One question though, I got the following error when I tried
Replacing that line with |
Which version on node are you using? I remember reading the spread operator was a recent addition. |
I am on v7.10.0. I wonder if it's really necessary to clone the config |
I can't see any issues with using |
This is really great! I'm still running in to a problem with locating static resources that webpack copies into the dist folder. Specifically font files used in css. Webpack copies them to the dist folder but when they are requested they are requested at the root and hence a 404. Any thoughts? |
@grufffta any thoughts? |
I presume this is font awesome, I managed to reproduce the issue and get the urls corrected by adding the following rule above the existing font file-loader.
The FA css references the fonts with a |
So I have looked at this a bit more and resolved the rendering issue. @ItWorksOnMyMachine @JeroenVinke |
…static resources The webpack build moves files into the /dist/ folder and resources are loaded from the root '/' publicPath This adds a change to the webpack.netcore.config.js file that customizes webpack to work with javascript services by adding the publicPath to the url and file loaders. Relates to a discussion on a previous PR aurelia#741
Sorry, I posted this question to a few places and completely forgot I posted it here as well. I did resolve it, and it was as "simple" as setting the publicPath property in my webpack.config.js file to publicPath: baseUrl + 'dist/'. In this case, baseUrl == '/' |
Hi,
I have updated the template for the javascriptservices to fix issues #734 and #701
I have updated the references to use the new meta package, fixed an issue where the index cshtml incorrectly had boot as the Aurelia app and allowed .net core to find the production files produced in the dist folder.
I did notice there was a failing test (nesting of dist folders) but this was before I made any changes so I didn't want to touch that with this pull request.
Hope you don't mind.
Thanks
Gareth