简体   繁体   中英

Dynamic bundling with MVC6 / ASP.Net 5

Previously with MVC5 and ASP.Net 4.5 there was Bundling and Minification as a server side action. The fine thing IMHO about this was, that I was able to have some code to be executed which discovers files to be included - even if these files weren't present at development time. Imagine a platform, where modules can be uploaded - with a module having eg SCSS and/or JSX included. Those modules are unpacked somewhere on the file system (App_Data for example) and my code searches for all relevant stuff there and adds it to my bundles.

Now with ASP.Net 5 there is no such bundling anymore but instead the option to write gulp tasks for that. As far as I understand (but maybe I'm just wrong?) these tasks are executed at development/publish time - and: locally. Whatever might get uploaded as described above hence is not discovered.

Is there a way to have such a gulp task get executed by - let's say: an OWIN middleware? Or is there another - maybe better - option to get this done?

Thanks for any hints,

Mario

PS A good example of such a system with modules uploaded and bundled at startup is: https://github.com/VirtoCommerce/vc-community

these tasks are executed at development/publish time - and: locally

You're correct; that's the intent. What you want to do is publish the result of those gulp tasks. For example, if you're using Browserify, publish the .js file and .css file that is produced by the gulp-browserify task. Similarly for Webpack .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM