aspnet / JavaScriptServices

[Archived] This repository has been archived
Apache License 2.0
3.03k stars 518 forks source link

Missing main-server.js after dotnet publish #1159

Closed bpicolo closed 7 years ago

bpicolo commented 7 years ago

Seems that ClientApp/dist isn't getting copied with publish.

Seems this is required for full production builds (but is not currently in the config)?

    <ItemGroup>
      <DistFiles Include="ClientApp\dist\**" />
      <ResolvedFileToPublish Include="@(DistFiles-&gt;'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
        <RelativePath>%(DistFiles.Identity)</RelativePath>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </ResolvedFileToPublish>
    </ItemGroup>
stephtr commented 7 years ago

At the moment all templates which utilize server side rendering (Angular and ReactRedux) have <DistFiles Include="wwwroot\dist\**; ClientApp\dist\**" /> already included in their project file. Which template and version are you talking about?

bpicolo commented 7 years ago

@stephtr think it might be the baseline react spa? That or I'm on an old version of reactredux that was missing it https://github.com/aspnet/JavaScriptServices/blob/d2eaa36372a4c78f5598783063260d315f98dd42/templates/ReactSpa/ReactSpa.csproj#L49

stephtr commented 7 years ago

The react spa template doesn't use server side rendering, therefore no server bundle gets generated. As far as I know the react redux template copies the server bundle since they started using csproj.

bpicolo commented 7 years ago

@stephtr Huh. It's possible I did some weird copy pasting between dirs of different setups. :) I'll close this out. Thanks for taking a look!