Created
October 31, 2019 10:40
-
-
Save tristolliday/1cfb57b791f827c50da8215b5346ac76 to your computer and use it in GitHub Desktop.
an example of using msbuild in a gulp 4 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ReadMe in msbuild repo: https://github.com/jhaker/nodejs-msbuild | |
| var gulp = require("gulp"); | |
| var _msbuild = require('msbuild'); | |
| var config = require("./gulp-config.json"); // use this to store all your .csproj/.sln related project details | |
| const msbuildTask = function (cb) { | |
| var msbuild = new _msbuild(cb); | |
| msbuild.sourcePath = config.project; | |
| msbuild.config('version', '16.0'); | |
| msbuild.configuration = config.buildConfiguration; | |
| msbuild.outputPath = config.websiteRoot; | |
| // msbuild.overrideParams.push('/clp:ErrorsOnly'); // enable to make verbose | |
| msbuild.overrideParams.push('/p:outputPath=' + config.websiteRoot); | |
| msbuild.build(); | |
| }; | |
| exports.msbuildTask = series(msbuildTask); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment