diff --git a/change/react-native-windows-2020-04-14-11-43-18-releasebundle.json b/change/react-native-windows-2020-04-14-11-43-18-releasebundle.json new file mode 100644 index 00000000000..cddc40b0588 --- /dev/null +++ b/change/react-native-windows-2020-04-14-11-43-18-releasebundle.json @@ -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" +} \ No newline at end of file diff --git a/packages/E2ETest/windows/ReactUWPTestApp/ReactUWPTestApp.csproj b/packages/E2ETest/windows/ReactUWPTestApp/ReactUWPTestApp.csproj index 07275254969..863452d52a0 100644 --- a/packages/E2ETest/windows/ReactUWPTestApp/ReactUWPTestApp.csproj +++ b/packages/E2ETest/windows/ReactUWPTestApp/ReactUWPTestApp.csproj @@ -174,11 +174,9 @@ 16.0 + - - echo WorkingDir %CD% - npx --no-install yarn run bundle - + dist/app/index.js - - - - - + + + + + \ No newline at end of file diff --git a/vnext/PropertySheets/Bundle.Cpp.targets b/vnext/PropertySheets/Bundle.Cpp.targets index 1ad7e09acf6..ef11a97b368 100644 --- a/vnext/PropertySheets/Bundle.Cpp.targets +++ b/vnext/PropertySheets/Bundle.Cpp.targets @@ -10,7 +10,7 @@ - $(BundleContentRoot)\%(RecursiveDir)%(Filename)%(Extension) + $([MSBuild]::MakeRelative($(ProjectDir),'$(BundleContentRoot)\%(RecursiveDir)%(Filename)%(Extension)')) true diff --git a/vnext/PropertySheets/Bundle.props b/vnext/PropertySheets/Bundle.props index 64f7c7eb244..883379ace3d 100644 --- a/vnext/PropertySheets/Bundle.props +++ b/vnext/PropertySheets/Bundle.props @@ -6,10 +6,49 @@ + + false true - Bundle - $(BundleContentRoot)\**\* + + + $([MSBuild]::NormalizePath('$(ProjectDir)\Bundle')) + + + $(BundleContentRoot)\**\* + + + index.windows.bundle + + + $([MSBuild]::NormalizePath('$(ProjectDir)\Bundle')) + + + true + false + + + + + + npx --no-install react-native bundle + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(ProjectDir), 'package.json')) + + + index.windows.js + index.js + + + + + + $(OutDir)\sourcemaps\react + diff --git a/vnext/local-cli/generator-windows/index.js b/vnext/local-cli/generator-windows/index.js index 13b2e476bf0..7387048d3dd 100644 --- a/vnext/local-cli/generator-windows/index.js +++ b/vnext/local-cli/generator-windows/index.js @@ -97,7 +97,7 @@ function copyProjectTemplateAndReplace( [ { from: path.join(srcRootPath, 'metro.config.js'), to: 'metro.config.js' }, { from: path.join(srcRootPath, '_gitignore'), to: path.join(windowsDir, '.gitignore') }, - { from: path.join(srcRootPath, 'b_gitignore'), to: path.join(windowsDir, newProjectName, bundleDir, '.gitignore') }, + { from: path.join(srcRootPath, 'b_gitignore'), to: path.join(windowsDir, newProjectName, '.gitignore') }, { from: path.join(srcRootPath, 'index.windows.bundle'), to: path.join(windowsDir, newProjectName, bundleDir, 'index.windows.bundle') }, { from: path.join(srcPath, projDir, 'MyApp.sln'), to: path.join(windowsDir, newProjectName + '.sln') }, ].forEach((mapping) => copyAndReplaceWithChangedCallback(mapping.from, destPath, mapping.to, templateVars, options.overwrite)); diff --git a/vnext/local-cli/generator-windows/templates/b_gitignore b/vnext/local-cli/generator-windows/templates/b_gitignore index d6b7ef32c84..917243bd7ae 100644 --- a/vnext/local-cli/generator-windows/templates/b_gitignore +++ b/vnext/local-cli/generator-windows/templates/b_gitignore @@ -1,2 +1 @@ -* -!.gitignore +/Bundle diff --git a/vnext/local-cli/generator-windows/templates/cpp/proj-experimental/MyApp.vcxproj b/vnext/local-cli/generator-windows/templates/cpp/proj-experimental/MyApp.vcxproj index 3e6ccd65be1..f6a21a959da 100644 --- a/vnext/local-cli/generator-windows/templates/cpp/proj-experimental/MyApp.vcxproj +++ b/vnext/local-cli/generator-windows/templates/cpp/proj-experimental/MyApp.vcxproj @@ -19,6 +19,9 @@ <%=certificateThumbprint%> password + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\ + @@ -71,7 +74,7 @@ - + @@ -150,13 +153,8 @@ - - - - npx --no-install react-native bundle --platform windows --entry-file index.js --bundle-output $(MSBuildThisFileDirectory)/Bundle/index.windows.bundle --assets-dest $(MSBuildThisFileDirectory)/Bundle - - - + + diff --git a/vnext/local-cli/generator-windows/templates/cpp/proj/MyApp.vcxproj b/vnext/local-cli/generator-windows/templates/cpp/proj/MyApp.vcxproj index da48fb3cb65..d6970f786da 100644 --- a/vnext/local-cli/generator-windows/templates/cpp/proj/MyApp.vcxproj +++ b/vnext/local-cli/generator-windows/templates/cpp/proj/MyApp.vcxproj @@ -19,6 +19,9 @@ <%=certificateThumbprint%> password + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\ + @@ -71,7 +74,7 @@ - + @@ -149,19 +152,14 @@ - + {f7d32bd0-2749-483e-9a0d-1635ef7e3136} - - - - npx --no-install react-native bundle --platform windows --entry-file index.js --bundle-output $(MSBuildThisFileDirectory)/Bundle/index.windows.bundle --assets-dest $(MSBuildThisFileDirectory)/Bundle - - - + + diff --git a/vnext/local-cli/generator-windows/templates/cs/proj/MyApp.csproj b/vnext/local-cli/generator-windows/templates/cs/proj/MyApp.csproj index 2b598cbc339..e7010aff763 100644 --- a/vnext/local-cli/generator-windows/templates/cs/proj/MyApp.csproj +++ b/vnext/local-cli/generator-windows/templates/cs/proj/MyApp.csproj @@ -22,6 +22,9 @@ password false + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\ + true bin\x86\Debug\ @@ -151,7 +154,7 @@ - + {f7d32bd0-2749-483e-9a0d-1635ef7e3136} Microsoft.ReactNative @@ -159,17 +162,13 @@ 2.3.191129002 - + 16.0 - - - npx --no-install react-native bundle --platform windows --entry-file index.js --bundle-output $(MSBuildThisFileDirectory)/Bundle/index.windows.bundle --assets-dest $(MSBuildThisFileDirectory)/Bundle - - - + +