feat(windows): add example app (#1937)

Added example app for Windows
This commit is contained in:
Marlene Cota
2023-01-09 03:48:20 -08:00
committed by GitHub
parent a21e47d3a1
commit a118c879c7
41 changed files with 2266 additions and 32 deletions

View File

@@ -7,7 +7,12 @@ const pack = require('../package.json');
const root = path.resolve(__dirname, '..');
const modules = [...Object.keys(pack.peerDependencies)];
const fs = require('fs');
const rnwPath = fs.realpathSync(
path.resolve(require.resolve('react-native-windows/package.json'), '..'),
);
const modules = [...Object.keys(pack.peerDependencies), 'react-native-windows'];
module.exports = {
projectRoot: __dirname,
@@ -20,6 +25,15 @@ module.exports = {
modules.map(
m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`),
),
// This stops "react-native run-windows" from causing the metro server to
// crash if its already running
new RegExp(
`${path.join(__dirname, 'windows').replace(/[/\\]+/g, '/')}.*`,
),
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild
new RegExp(`${rnwPath}/build/.*`),
new RegExp(`${rnwPath}/target/.*`),
/.*\.ProjectImports\.zip/,
),
extraNodeModules: modules.reduce((acc, name) => {