Skip to content

Commit

Permalink
Merge pull request #149 from CatalystCode/issue147
Browse files Browse the repository at this point in the history
Fixes #147 - Adds support for F5 bundling in Playground.
  • Loading branch information
rozele committed Feb 8, 2016
2 parents 877d269 + 1503e41 commit 56d163e
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 57,374 deletions.
5 changes: 4 additions & 1 deletion ReactWindows/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@ packages/
#Other files
*.DotSettings
.vs/
*project.lock.json
*project.lock.json

#JavaScript files
*.jsbundle
9 changes: 9 additions & 0 deletions ReactWindows/Bundle.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="DoBundle">
<Message Text="Installing react-native node module..." />
<Exec Command="npm install" />
<Message Text="Bundling the entry file..." />
<Exec Command="react-native bundle --entry-file=index.ios.js --bundle-output=main.jsbundle" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion ReactWindows/Playground/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public App()
this.Resuming += OnResuming;

_reactPage = new ReactPage(
"ms-appx:///Resources/main.dev.jsbundle",
"ms-appx:///main.jsbundle",
"ReactRoot",
new[] { new MainReactPackage() }.ToList(),
() => { /* TODO: back button handling */ });
Expand Down
51 changes: 46 additions & 5 deletions ReactWindows/Playground/Playground.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,56 @@
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Bundle|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Bundle\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS</DefineConstants>
<NoWarn>;2008</NoWarn>
<NoStdLib>true</NoStdLib>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Bundle|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Bundle\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS</DefineConstants>
<NoWarn>;2008</NoWarn>
<NoStdLib>true</NoStdLib>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Bundle|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Bundle\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS</DefineConstants>
<NoWarn>;2008</NoWarn>
<NoStdLib>true</NoStdLib>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<Content Include="ApplicationInsights.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="project.json" />
<Content Include="Resources\main.jsbundle">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Content Include="main.jsbundle">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\main.dev.jsbundle">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Include="project.json" />
<Content Include="index.ios.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -144,6 +183,8 @@
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import Project="..\Bundle.targets" />
<Target Name="BeforeBuild" DependsOnTargets="DoBundle" Condition=" '$(Configuration)' == 'Bundle' " />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Loading

0 comments on commit 56d163e

Please sign in to comment.