Is there possibility to run command before compression? #25447
-
I'd like to run my script during build and publish, which will modify
This is workaround (not fully working) for issue described here (there you can find background story): #22220 (comment) . |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We don't have a specific MSBuild target for this purpose. You could look at the framework sources and try to find a place that's suitable for plugging in your custom logic, but it's outside the normal range of supported scenarios. However instead of doing this I would make a different suggestion. I see your goal is to load <script>
var originalFetch = window.fetch;
window.fetch = function(url, options) {
if (url === '_framework/blazor.boot.json') {
// Custom logic to return any content you want
return originalFetch('https://example.com/myCustomUrl/blazor.boot.json', options);
} else {
// Use default logic
return originalFetch.apply(this, arguments);
}
};
</script>
<script src="_framework/blazor.webassembly.js"></script> Note: I'm just writing this code from memory - I haven't tested it, so there may be small errors to correct. But I expect you'll get the idea. |
Beta Was this translation helpful? Give feedback.
We don't have a specific MSBuild target for this purpose. You could look at the framework sources and try to find a place that's suitable for plugging in your custom logic, but it's outside the normal range of supported scenarios.
However instead of doing this I would make a different suggestion. I see your goal is to load
blazor.boot.json
from a custom location. You could do that by patching JavaScript'sfetch
function. For example: