Building JS assets with MSBuild
After making MSBuild transform my files I’ve faced with another problem - JavaScript.
Everyone knows a JS developers game: take a random word; google RandomWord.js
; if you’ve found a JS library - drink. The best way to die of alcohol, really. As for JS “build” tools, there are several “flagmans” like Gulp, NPM and so on. But not everyone uses them. Remember the game…
Problem
So we’ve got a JS “builder” such as Mimosa that’s used in your project. And we need to integrate it with MSBuild, including transforms and all other features. The problem is that our build tool produces files in a separate folder that MSBuild doesn’t know. So they won’t be automatically copied to output and transforms won’t be applied to them.
Solution
Here’s an example that will run Mimosa on Content
folder of the .NET project. After build completes, it will add all produced files to MSBuild Content
item group, so MSBuild will know what to copy to output.
You can use any build/convert tool here, it will work fine :)
blog comments powered by Disqus
Published
Category
msbuildTags
2020
August
- August 11, 2020 » Identifying AWS EBS volumes on instance
June
- June 24, 2020 » AWS S3 Website with private-only access
2018
September
- September 4, 2018 » Multiple ways of PowerShell templating
2017
September
- September 17, 2017 » Link: RDP URI scheme
August
- August 15, 2017 » Link: SSL settings and checks
- August 15, 2017 » Link: Template files substituter for Docker
- August 8, 2017 » Link: Classes in PowerShell
April
- April 15, 2017 » Bash tricks you didn't usually use
2016
August
- August 30, 2016 » Configuring RancherOS for use with AWS autoscaling + Swarm cluster
April
- April 26, 2016 » Building JS assets with MSBuild
- April 25, 2016 » Applying Web.config transforms to all config files
2015
August
- August 29, 2015 » Check if identifier is declared in Bash
2014
April
- April 2, 2014 » PID file management in Bash
- April 2, 2014 » Logging routine for Bash
- April 2, 2014 » Lock file management in Bash