-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
How to bundle static assets from multiple razor library packages #14726
Comments
Thanks for contacting us, @ToddThomson. |
Sorry, my post was a bit terse! I am clear on how to package static assets within a RCL. However, if I have AspNetCore 3 Web project that consumes multiple RCLs, is there a mechanism to bundle assets from these multiple RCLs? I would be interested in development time and production time scenarios. Issue #6349 mentions different bundling scenarios, but I am not clear if the design(s) were implemented. |
I took a look at |
@mkArtakMSFT please consider reopening this issue. It appears that I cannot reopen this issue myself. |
Perhaps AspNetCore Tooling Tests will provide some insights... |
I'm a bit uncertain about what |
@mkArtakMSFT Thanks Artak. I have a few leads to go on now. If I can access the aggregated staticwebassets build directory post build I may be able to construct bundles during development. I am not sure how using the aspnetcore bundle and minifier would work at runtime. Any guidance would be time saving and helpful! Edit: I will look at the doc you linked to above... |
@mkArtakMSFT OK, it is the publish step where all the publish/wwwroot/_content/libRCL/ directories are created that I want to get access to from my consuming MVC Web project. I should be able to use the runtime aspnetcore bundler or a gulp based bundler to reference the _content/ directory. What I am attempting to do is compose single js and css bundles from a set of included RCL packages or included projects. I feel the answer is in the access to the |
Ok. So the MS AspNetCore project does not include a built-in bundler/minifier for static assets. I assumed that the NuGet package, that used bundleconfig.json was from Microsoft (I am migrating to AspNetCore 3 from AspNetCore 2). That's OK with me as I have always used gulp tasks. So my question comes down to this: When publishing the MVC Web App that consumes multiple RCL packages, a |
@javiercn I will need your expertise here. Can you please see whether this is possible and how (if yes)? |
@ToddThomson We don't offer a solution for this out of the box, but all the infrastructure is done through MSBuild and there are extensibility points that should make this scenarios possible. In particular, you should be able to add your own targets to get the list of all the assets in the app, run any code you want, and produce an updated list of assets that the app will use. For example, you can add your own task to
|
@javiercn Thank-you. I've looked at the Razor Sdk StaticWebAssets.targets tasks and will likely use:
as a guide for my target. |
Is there an AspNetCore built-in design for this?
The text was updated successfully, but these errors were encountered: