How to use @expo/electron-adapter - 2 common examples

To help you get started, we’ve selected a few @expo/electron-adapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo-cli / packages / electron-adapter / src / Config.ts View on Github external
export function ensureElectronConfig(projectPath: string) {
  const outputPath = path.resolve(projectPath, 'electron-webpack.js');
  if (!fs.pathExistsSync(outputPath)) {
    fs.copy(path.resolve(__dirname, '../template/electron-webpack.js'), outputPath);
  }
}

export async function ensureMinProjectSetupAsync(projectRoot: string): Promise {
  ensureElectronConfig(projectRoot);
  await ensureGitIgnoreAsync(projectRoot);
  await ensureDependenciesAreInstalledAsync(projectRoot);
}

const generatedTag = `@generated: @expo/electron-adapter@${
  require('@expo/electron-adapter/package.json').version
}`;

function createBashTag(): string {
  return `# ${generatedTag}`;
}

export async function ensureGitIgnoreAsync(projectRoot: string): Promise {
  const destinationPath = path.resolve(projectRoot, '.gitignore');

  // Ensure a default expo .gitignore exists
  if (!(await fs.pathExists(destinationPath))) {
    return;
  }

  // Ensure the .gitignore has the required fields
  let contents = await fs.readFile(destinationPath, 'utf8');

@expo/electron-adapter

Use Electron with Expo

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis