|
22 | 22 | <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
|
23 | 23 | <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
|
24 | 24 | </ItemGroup>
|
| 25 | + |
| 26 | + |
| 27 | + <Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' "> |
| 28 | + <Message Importance="high" Text="Installing any non-peer missing dependencies.." /> |
| 29 | + <Exec Command="npm install" /> |
| 30 | + |
| 31 | + <!-- It would seem, that the npm install cmd targets the parent directory(natural path of the routine), and yet, the node webpack execution does not. So we go up one level --> |
| 32 | + <Message Importance="high" Text="Performing first-run Webpack build..." /> |
| 33 | + <Exec Command="node ../node_modules/webpack/bin/webpack.js --config ../client-react/webpack.config.js" /> |
| 34 | + |
| 35 | + <Message Importance="high" Text="Starting up docker instances (if not started).." /> |
| 36 | + <Exec Command="docker-compose up -d" /> |
| 37 | + </Target> |
| 38 | + |
| 39 | + <Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish"> |
| 40 | + <!-- As part of publishing, ensure the JS resources are freshly built in production mode --> |
| 41 | + <Exec Command="npm install" /> |
| 42 | + <Exec Command="node ../node_modules/webpack/bin/webpack.js --config ../client-react/webpack.config.js --env.prod" /> |
| 43 | + |
| 44 | + <!-- Include the newly-built files in the publish output --> |
| 45 | + <ItemGroup> |
| 46 | + <DistFiles Include="wwwroot\*.js;" /> |
| 47 | + <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)"> |
| 48 | + <RelativePath>%(DistFiles.Identity)</RelativePath> |
| 49 | + <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |
| 50 | + </ResolvedFileToPublish> |
| 51 | + </ItemGroup> |
| 52 | + |
| 53 | + <ItemGroup Condition="'$(Configuration)'=='Debug'"> |
| 54 | + <NpmFiles Include="..\node_modules\**;..\package.json;..\client-react\webpack.config.js;..\client-react\tsconfig.json;..\postcss.config.js;..\.babelrc" /> |
| 55 | + <ResolvedFileToPublish Include="@(NpmFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)"> |
| 56 | + <RelativePath>%(NpmFiles.Identity)</RelativePath> |
| 57 | + <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |
| 58 | + </ResolvedFileToPublish> |
| 59 | + </ItemGroup> |
| 60 | + </Target> |
25 | 61 | </Project>
|
0 commit comments