-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Release bundle builds should have --dev false flag #4603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dff3be7
e0976f2
d414283
b407b4d
5885485
d29db09
3a4a926
ce15054
a1e466a
3abe545
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "Make default template build non-dev bundle when not using debug configuration", | ||
| "packageName": "react-native-windows", | ||
| "email": "acoates@microsoft.com", | ||
| "dependentChangeType": "patch", | ||
| "date": "2020-04-14T18:43:18.289Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -198,11 +198,7 @@ | |
| <Import Project="..\packages\Microsoft.UI.Xaml.2.3.191129002\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\packages\Microsoft.UI.Xaml.2.3.191129002\build\native\Microsoft.UI.Xaml.targets')" /> | ||
| <Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" /> | ||
| </ImportGroup> | ||
| <PropertyGroup> | ||
| <BundleCommand> | ||
| npx --no-install yarn run bundle-cpp | ||
| </BundleCommand> | ||
| </PropertyGroup> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Bundle.props" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. normally you'd put all the imported props files before any propertygroup. I think this is the same end result in this case as you don't seem to be overwriting/overriding anything in the bundle.props, but it'd be worth sticking to the layout |
||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Bundle.Cpp.targets" /> | ||
| <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
| <PropertyGroup> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,13 +174,9 @@ | |
| <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '16.0' "> | ||
| <VisualStudioVersion>16.0</VisualStudioVersion> | ||
| </PropertyGroup> | ||
| <PropertyGroup> | ||
| <BundleCommand> | ||
| npx --no-install yarn run bundle-cs | ||
| </BundleCommand> | ||
| </PropertyGroup> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Bundle.targets" /> | ||
| <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" /> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Bundle.props" /> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Bundle.targets" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here in this C# project we use Bundle.targets but in C++ we use Bundle.cpp.targets. Why the difference? Can we just use one targets file and if we need to have different behavior it can figure it out for us? |
||
| <!-- 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"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,3 +90,4 @@ packages/ | |
| #Files generated by the VS build | ||
| **/Generated Files/** | ||
|
|
||
| playground/Bundle | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,13 +171,11 @@ | |
| </ItemGroup> | ||
|
|
||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Bundle.props" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move up before targets (really before the first PropertyGroup) |
||
| <PropertyGroup> | ||
| <BundleCommand> | ||
| npx --no-install react-native bundle --platform windows --entry-file Samples/rntester.tsx --bundle-output $(MSBuildThisFileDirectory)/Bundle/index.windows.bundle --assets-dest $(MSBuildThisFileDirectory)/Bundle | ||
| </BundleCommand> | ||
| <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled> | ||
| <BundleEntryFile>Samples/rntester.tsx</BundleEntryFile> | ||
| </PropertyGroup> | ||
| <Import Project="..\..\..\..\vnext\PropertySheets\Bundle.Cpp.targets" /> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Bundle.Cpp.targets" /> | ||
| <ImportGroup Label="ExtensionTargets"> | ||
| <Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" /> | ||
| <Import Project="..\packages\Microsoft.UI.Xaml.2.3.191129002\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\packages\Microsoft.UI.Xaml.2.3.191129002\build\native\Microsoft.UI.Xaml.targets')" /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,10 +6,49 @@ | |
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
|
||
| <PropertyGroup> | ||
|
|
||
| <!-- | ||
| UseBundle causes the bundle to be created and included inside the application install. And defines the BUNDLE #define in code, | ||
| which causes the app to load from the bundle file rather than loading the bundle from a bundle server | ||
| --> | ||
| <UseBundle Condition=" '$(Configuration)' == 'Debug' and '$(UseBundle)' == '' ">false</UseBundle> | ||
| <UseBundle Condition=" '$(Configuration)' == 'Release' and '$(UseBundle)' == '' ">true</UseBundle> | ||
| <BundleContentRoot Condition=" '$(BundleContentRoot)' == '' ">Bundle</BundleContentRoot> | ||
| <BundleContent Condition = " '$(BundleContent)' == '' and '$(BundleContentRoot)' != '' ">$(BundleContentRoot)\**\*</BundleContent> | ||
|
|
||
| <!-- Root directory where bundle assets will be copied to, be sure to update BundleContent if you change this --> | ||
| <BundleContentRoot Condition=" '$(BundleContentRoot)' == '' ">$([MSBuild]::NormalizePath('$(ProjectDir)\Bundle'))</BundleContentRoot> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think ProjectDir is a VS thing whereas MSBuildProjectDirectory is the MSBuild property - are you seeing this work on the command line too? |
||
|
|
||
| <!-- Files included in BundleContent will be included in the application install - by default this includes the bundle file, and assets from the bundler --> | ||
| <BundleContent Condition=" '$(BundleContent)' == '' and '$(BundleContentRoot)' != '' ">$(BundleContentRoot)\**\*</BundleContent> | ||
|
|
||
| <!-- The name of the JS bundle assert to be placed in $(BundleOutputPath)--> | ||
| <BundleAssetName Condition="'$(BundleAssetName)' == ''">index.windows.bundle</BundleAssetName> | ||
|
|
||
| <!-- Where should be final JS bundle be written to --> | ||
| <BundleOutputPath Condition="'$(BundleOutputPath)' == ''">$([MSBuild]::NormalizePath('$(ProjectDir)\Bundle'))</BundleOutputPath> | ||
|
|
||
| <!-- Should the bundle created be a dev bundle --> | ||
| <UseDevBundle Condition="'$(UseDevBundle)' == '' and '$(Configuration)' == 'Debug'">true</UseDevBundle> | ||
| <UseDevBundle Condition="'$(UseDevBundle)' == '' and '$(Configuration)' != 'Debug'">false</UseDevBundle> | ||
|
|
||
| <!-- Extra arguments to pass to the bundler command --> | ||
| <BundlerExtraArgs Condition="'$(BundlerExtraArgs)' == ''"></BundlerExtraArgs> | ||
|
|
||
| <!-- Command to use to create a bundle --> | ||
| <BundleCliCommand Condition="'$(BundleCliCommand)' == ''">npx --no-install react-native bundle</BundleCliCommand> | ||
|
|
||
| <!-- This should be the app package root, this is where the bundle command will be run from --> | ||
| <BundleCommandWorkingDir Condition="'$(BundleCommandWorkingDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(ProjectDir), 'package.json'))</BundleCommandWorkingDir> | ||
|
|
||
| <!-- Entry file of the JS bundle. Defaults to use index.windows.js if it exists, otherwise index.js --> | ||
| <BundleEntryFile Condition="'$(BundleEntryFile)' == '' and Exists('$(BundleCommandWorkingDir)\index.windows.js')">index.windows.js</BundleEntryFile> | ||
| <BundleEntryFile Condition="'$(BundleEntryFile)' == ''">index.js</BundleEntryFile> | ||
|
|
||
| <!-- Optional config file for the bundle command (metro will use metro.config.js by default) --> | ||
| <BundleConfigFile Condition="'$(BundleConfigFile)' == ''"></BundleConfigFile> | ||
|
|
||
| <!-- Location where source map file for the JS bundle will be created --> | ||
| <BundleSourceMapDir Condition="'$(BundleSourceMapDir)' == ''">$(OutDir)\sourcemaps\react</BundleSourceMapDir> | ||
|
|
||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| * | ||
| !.gitignore | ||
| /Bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated?