chore: cleanup whitespace in docs (#26356)
This commit is contained in:
parent
3814a56d48
commit
43dbd1bdf8
45 changed files with 129 additions and 72 deletions
|
@ -3,6 +3,7 @@
|
|||
If your app runs with Electron 6.0.8 or later, you can now build it for Windows 10 on Arm. This considerably improves performance, but requires recompilation of any native modules used in your app. It may also require small fixups to your build and packaging scripts.
|
||||
|
||||
## Running a basic app
|
||||
|
||||
If your app doesn't use any native modules, then it's really easy to create an Arm version of your app.
|
||||
|
||||
1. Make sure that your app's `node_modules` directory is empty.
|
||||
|
@ -26,17 +27,21 @@ if (process.arch === 'x64') {
|
|||
If you want to target arm64, logic like this will typically select the wrong architecture, so carefully check your application and build scripts for conditions like this. In custom build and packaging scripts, you should always check the value of `npm_config_arch` in the environment, rather than relying on the current process arch.
|
||||
|
||||
### Native modules
|
||||
|
||||
If you use native modules, you must make sure that they compile against v142 of the MSVC compiler (provided in Visual Studio 2017). You must also check that any pre-built `.dll` or `.lib` files provided or referenced by the native module are available for Windows on Arm.
|
||||
|
||||
### Testing your app
|
||||
|
||||
To test your app, use a Windows on Arm device running Windows 10 (version 1903 or later). Make sure that you copy your application over to the target device - Chromium's sandbox will not work correctly when loading your application assets from a network location.
|
||||
|
||||
## Development prerequisites
|
||||
|
||||
### Node.js/node-gyp
|
||||
|
||||
[Node.js v12.9.0 or later is recommended.](https://nodejs.org/en/) If updating to a new version of Node is undesirable, you can instead [update npm's copy of node-gyp manually](https://github.com/nodejs/node-gyp/wiki/Updating-npm's-bundled-node-gyp) to version 5.0.2 or later, which contains the required changes to compile native modules for Arm.
|
||||
|
||||
### Visual Studio 2017
|
||||
|
||||
Visual Studio 2017 (any edition) is required for cross-compiling native modules. You can download Visual Studio Community 2017 via Microsoft's [Visual Studio Dev Essentials program](https://visualstudio.microsoft.com/dev-essentials/). After installation, you can add the Arm-specific components by running the following from a _Command Prompt_:
|
||||
|
||||
```powershell
|
||||
|
@ -49,6 +54,7 @@ vs_installer.exe ^
|
|||
```
|
||||
|
||||
#### Creating a cross-compilation command prompt
|
||||
|
||||
Setting `npm_config_arch=arm64` in the environment creates the correct arm64 `.obj` files, but the standard _Developer Command Prompt for VS 2017_ will use the x64 linker. To fix this:
|
||||
|
||||
1. Duplicate the _x64_x86 Cross Tools Command Prompt for VS 2017_ shortcut (e.g. by locating it in the start menu, right clicking, selecting _Open File Location_, copying and pasting) to somewhere convenient.
|
||||
|
@ -76,8 +82,8 @@ By default, `node-gyp` unpacks Electron's node headers and downloads the x86 and
|
|||
|
||||
Substitute `6.0.9` for the version you're using.
|
||||
|
||||
|
||||
## Cross-compiling native modules
|
||||
|
||||
After completing all of the above, open your cross-compilation command prompt and run `set npm_config_arch=arm64`. Then use `npm install` to build your project as normal. As with cross-compiling x86 modules, you may need to remove `node_modules` to force recompilation of native modules if they were previously compiled for another architecture.
|
||||
|
||||
## Debugging native modules
|
||||
|
@ -92,4 +98,5 @@ Debugging native modules can be done with Visual Studio 2017 (running on your de
|
|||
6. Once attached, set any appropriate breakpoints and resume JavaScript execution using Chrome's [remote tools for Node](debugging-main-process.md).
|
||||
|
||||
## Getting additional help
|
||||
|
||||
If you encounter a problem with this documentation, or if your app works when compiled for x86 but not for arm64, please [file an issue](../development/issues.md) with "Windows on Arm" in the title.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue