Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last package.json for ts. #28

Open
bitrix1 opened this issue Mar 2, 2019 · 4 comments
Open

Last package.json for ts. #28

bitrix1 opened this issue Mar 2, 2019 · 4 comments

Comments

@bitrix1
Copy link

bitrix1 commented Mar 2, 2019

{
  "name": "react-test",
  "version": "0.1.0",
  "private": true,
  "homepage": "./",
  "main": "src/electron-starter.js",
  "resolutions": {
    "@types/react": "^16.8.6"
  },
  "dependencies": {
    "electron": "^4.0.6",
    "react": "^16.8.3",
    "react-dom": "16.8.3"
  },
  "scripts": {
    "start": "react-scripts-ts start",
    "build": "react-scripts-ts build",
    "test": "react-scripts-ts test --env=jsdom",
    "eject": "react-scripts-ts eject",
    "electron": "electron ."
  },
  "devDependencies": {
    "@types/react-dom": "^16.8.2",
    "@types/electron": "^1.6.10",
    "@types/jest": "^24.0.9",
    "@types/node": "^11.10.4",
    "@types/react": "^16.8.6",
    "foreman": "^2.0.0",
    "react-scripts-ts": "3.1.0",
    "typescript": "^3.3.3333"
  }
}

@bitrix1
Copy link
Author

bitrix1 commented Mar 2, 2019

Import window as any in App.tsx

const electron = (window as any).require('electron');
const fs = electron.remote.require('fs');
console.log('electron', electron);
const ipcRenderer = electron.ipcRenderer;

@gautamsi
Copy link

gautamsi commented Sep 5, 2019

I have tried this, problem is that it removes Type information and TypeScript is now clueless.

@csepulv
Copy link
Owner

csepulv commented Sep 5, 2019

Unfortunately I have no experience with Typescript, so I can't offer a suggestion on how to get this working with it.

@gautamsi
Copy link

gautamsi commented Sep 5, 2019

this was for @bitrix1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants