Skip to content

Commit 34c67fb

Browse files
davidsekarMarkPieszak
authored andcommitted
Modified .csproject to emit the wwwroot/dist folder, if the folder is not created yet (#390)
1 parent 593622f commit 34c67fb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Asp2017.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@
2323
<!-- Files not to publish (note that the 'dist' subfolders are re-added below) -->
2424
<Content Remove="ClientApp\**" />
2525
</ItemGroup>
26+
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
27+
<!-- Ensure Node.js is installed -->
28+
<Exec Command="node --version" ContinueOnError="true">
29+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
30+
</Exec>
31+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
32+
33+
<!-- In development, the dist files won't exist on the first run or when cloning to
34+
a different machine, so rebuild them if not already present. -->
35+
<Message Importance="high" Text="Performing first-run Webpack build..." />
36+
<Exec Command="npm install" />
37+
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" />
38+
<Exec Command="node node_modules/webpack/bin/webpack.js" />
39+
</Target>
2640
<Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish">
2741
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
2842
<Exec Command="npm install" />

0 commit comments

Comments
 (0)