ASP.NET using MS and Grunt packages with CDN

I currently use the built-in BundleConfigs that work fine locally and deployed, but I would like to move all my static assets to CDN. I know that the syntax of the package allows you to specify a CDN path that will work, but does anyone have a good solution to synchronize BundleConfigs with your deployment scripts, which will ultimately handle the concat / minify / copy of your CDN statistics?

I am currently browsing Grunt to concat / minify my styles / scripts, but this will force me to manage all my packages in my BundleConfig.cs solution and then again in my Gruntfile.js. Not perfect...

Thoughts or suggestions? Thanks!

+4
source share
1 answer

If you intend to use Grunt to bind and minimize, I don’t think you need to use the ASP.NET web optimization infrastructure. Why use both? Just paste the links to your associated app.css and app.js files on your page and you're done. You can also use @if ... operators to include different versions of your files (development and production).

Also, check out Gulp.js , a newer alternative to Grunt, and this project template that already has the basic Gulp.js configurations in place: ASP.NET Solution Template

A few Gulp.js plugins that can help with CDN:

Gulp.js gulpfile.js, :

gulp build --production

.., HTML/LESS/JS Amazon S3 CDN.

+9

Source: https://habr.com/ru/post/1524802/


All Articles