Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

aspnet-webpack middleware - conditional/triggered webpack build #693

Closed
Aleksanderis opened this issue Feb 18, 2017 · 2 comments
Closed

Comments

@Aleksanderis
Copy link

Aleksanderis commented Feb 18, 2017

webpack-dev-middleware works surprisingly well with ASP.NET, with just one BUT - it's more suited for front-end development, but not when I need to rebuild just back-end changes. If I do some changes in back-end, and there are no changes in front-end - first page load takes a lot, because it compiles webpack on each start.

I think it would be really great to make some option to rebuild webpack stack conditionally.
With current state of things to remain productive, I need to maintain two configurations - when I'm working on front-end and when I'm working on back-end (not speaking about webpack-watcher approach).

Just some high-level ideas how it could work:

  • I'm aware something like that might be achieved with webpack itself (using DLLPlugin, cached vendor chunks, etc). However I just don't want to trigger webpack build.
  • Detect if entry files weren't changed (probably also webpack itself related way).
  • Trigger webpack middleware logic by navigating to some special route.
  • Maybe it's already possible to do somehow?
@dseferlis
Copy link

Maybe is not enough for your case, but did you try dotnet-watch?
https://docs.microsoft.com/en-us/aspnet/core/tutorials/dotnet-watch

@Aleksanderis
Copy link
Author

Aleksanderis commented Feb 19, 2017

Yes, I know about dotnet-watch (as well as about webpack watch), but yes - it's not always enough.;)
It happens quite often that everything (all watchers) was stopped, there are no real changes, and I want to start it quickly.
Seems it's an usual dilema with inventing ideal build workflow.. It always ends so, that it works for one case, but not for another..:)

Update: tried it with dotnet-watch, but unfortunately it's not useful at all in this case, because it re-executes Startup logic on each rebuild, which means it triggers webpack build all the time as well. I googled about dotnet watch run specifically and found a post about it, which accidentally was from this same repository.:))
This issue is - #545, which is closed, but there a new one created - #555. So it seems mine can be considered as duplicate of it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants