Open mtrutledge opened 5 years ago
I have a solution for that, you can run yarn from msbuild and even obtain yarn as a nuget package so it even builds on systems that do not have yarn.
I did not have time to check how the generators work and all that, but if you want to slack me I can show you how, it is like 4 or 5 config lines and even works on CI and all. Just slack me and I can show you, I unfortunately do not have it setup in any public repo at the moment.
My issue is for each template I want the interface to be the same. I want the user to be able to run yarn build and have everything build. But, if the user runs from Visual Studio I need to kick off the client build. I think I am going to set a .env variable when running from yarn build, then if I detect that variable I won't execute the client build from msbuild. This will prevent a build loop from occurring.
Would it work to have MSBuild just call yarn run client-build
, rather than needing to use an environment variable?
I will look into that when I fix this defect. At a quick glance, that does appear to work.
On Feb 26, 2019, at 10:37 AM, Brian Dukes notifications@github.com wrote:
Would it work to have MSBuild just call yarn run client-build, rather than needing to use an environment variable?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mtrutledge/generator-dnn/issues/70#issuecomment-467537161, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCJ_ninSebaXT9mq3g0XkZfBkY5ANNXks5vRXDlgaJpZM4bIGeZ.
Yes, it is possible to run any yarn script from msbuild and use conditions too.
In my own modules I only run yarn when doing a release build and it also works in azure devops pipelines without special tasks there, I just use the normal asp.net template and that is it.
Opening the sln in visual studio on Mac or windows does not fully build the projects because that task is up to yarn build. Probably need to remove the sln file or figure out how to alter the scripts so msbuild triggers front end compiles.