In my build process, the solution is built and then I run a custom task to preprocess our LESS files and minify the Javascript files. The result of this total process needs to be packed by Octopack, but Octopack starts packing immediately after the solution build, thus leaving out preprocessed and minified files. How can I change Octopack’s timing to include the preprocessed and minified files in the published NuGet package?
Hi Pascal,
Thanks for getting in touch. Octopack will only work at build time and its not possible to delay the Packaging. You’re gonna have to disable Octopack (just removing the msbuild arguments should do) and add an extra step to your build process to Pack your app after minifying your files.
Warm regards,
Dalmiro
Hi Dalmiro,
Thanks for your answer. I guess you mean I should configure my msbuild file to run OctoPack as a separate “target” after the minification. If so, what is the correct way “” definition? Or should I approach this differently?
Thank you.
Pascal
Hi Pascal,
What i’m recommending is for you to add another step to your build process so it looks like this:
-
Run MSbuild to compile your source code WITHOUT running Octopack. No packages will get created at this point.
-
Minify your files
Hope that makes sense.
Dalmiro