diff --git a/change/react-native-windows-2019-11-25-11-54-34-updatedoc.json b/change/react-native-windows-2019-11-25-11-54-34-updatedoc.json new file mode 100644 index 00000000000..bb4744a8734 --- /dev/null +++ b/change/react-native-windows-2019-11-25-11-54-34-updatedoc.json @@ -0,0 +1,8 @@ +{ + "type": "none", + "comment": "Update doc to removing DebugBundle and ReleaseBundle", + "packageName": "react-native-windows", + "email": "licanhua@live.com", + "commit": "806c4059c397d9ff09054461e368a78cfb50880b", + "date": "2019-11-25T19:54:34.125Z" +} \ No newline at end of file diff --git a/vnext/docs/ConsumingRNW.md b/vnext/docs/ConsumingRNW.md index 1e092b6dd98..591f6425532 100644 --- a/vnext/docs/ConsumingRNW.md +++ b/vnext/docs/ConsumingRNW.md @@ -84,6 +84,58 @@ See [Native Modules and React Native Windows](NativeModules.md). ## Building a standalone React Native Windows App Follow these steps to build a version of your app that you can install or publish to the store. This version will package your bundle and assets into the appx package so you don't need to run Metro. +- Open the solution in Visual Studio +- Select the Release configuration from the Configuration Manager dropdown. +- Build the solution. You can now launch without first launching Metro. +- If you want to build an appx package to share or publish, use the Project => Publish => Create App Packages... option. + +You may hit [error Unable to resolve module `warnOnce`](https://github.com/microsoft/react-native-windows/issues/3670) if you compile the project from Visual Studio IDE. You can workaround the problem by using lower driver-letter in `BundleCommand`. For example, if your solution directory is `C:\repo\myproj\windows`, then modify `BundleCommand` in your project from + +``` + + cd $(SolutionDir).. + ... + +``` +to +``` + + cd c:\repo\myproj + ... + +``` + +## Migrating your project from old React Native Windows template +If your application is created from old React Native template, you have to remove DebugBundle and ReleaseBundle configurations manually, then make Release configuration to support Bundle. You can find examples in [PR 3654](https://github.com/microsoft/react-native-windows/pull/3654). Here is the steps to migrate your project manually: +- Remove DebugBundle and ReleaseBundle from the solution. + +- Provide BundleCommand in the project file +``` + + + cd $(SolutionDir).. + react-native bundle --platform windows --entry-file index.windows.js --bundle-output windows/SampleAppCpp/Bundle/index.windows.bundle --assets-dest windows/SampleAppCpp/Bundle + + +``` + +- Import Bundle.targets or Bundle.Cpp.targets. + +For CS project +``` + +``` + +For Cpp project +``` + +``` + +## Building a standalone React Native Windows App which is created from old React Native Windows template +Note: DebugBundle and ReleaseBundle are not supported anymore because of [issue 3657](https://github.com/microsoft/react-native-windows/issues/3657). Please follow the migrate steps above to migrate your project if you want to use newer version of React Native Windows. + +Follow these steps to build a version of your app that you can install or publish to the store. This version will package your bundle and assets into the appx package so you don't need to run Metro. + - Open the solution in Visual Studio - Select the DebugBundle or ReleaseBundle configuration from the Configuration Manager dropdown. DebugBundle is similar to Debug in that it adds more debugging info to the native code. Use this if you want to debug the native code. ReleaseBundle is similar to Release, you'll typically use this when producing a final package to publish to the store. - Build the solution. You can now launch without first launching Metro.