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

OUR REACT BUILD - how to #129

Open
pohadkar opened this issue May 20, 2019 · 3 comments
Open

OUR REACT BUILD - how to #129

pohadkar opened this issue May 20, 2019 · 3 comments

Comments

@pohadkar
Copy link
Collaborator

jak postupovat pri buildovani naseho vlastniho serveroveho reactu

@pohadkar
Copy link
Collaborator Author

  1. na serveru musi byt node.js
  2. zalozil jsem si novy adresar a napsal v nem: "npx create-react-app my-app" (probehlo bez chyb i warningu)
  3. dale jsme chteli delat js buildy do adresare dist. nejdriv jsem provedl "npm run build" ovsem to vytvorilo pouze adresar build (stale bez chyb i warningu)
  4. pak jsem nasel plugin, ktery ty dist dela. https://www.npmjs.com/package/react-build-dist
  5. nainstaloval jsem ho tam upravenym prikazem "npm install --dev react-build-dist" (zde byla spousta warningu)
  6. do package.json jsem do kolonky script pridal
    "scripts": {
    "build:dist": "react-build-dist"
    }
  7. dist buildy se ted delaji "npm run build:dist" (prvni pokus spousta chyb, ale udelalo se neco)
  8. nainstaloval jsem react json form "npm install react-jsonschema-form --save" (warningy ze chybi typescript)
  9. nainstaloval jsem typescript "npm install typescript" (nejake warningy ze preskakuje oprtional dependency)
  10. znovu build "npm run build:dist" (zase spousta chyb, nicmene to zase neco vygenerovalo)
  11. pouziti vysledneho scriptu ve strance:
    chyba: Error: ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.

@pohadkar
Copy link
Collaborator Author

jeste dulezita vec. nevime v jakem vztahu je vysledny dist build a obsah src/index.js
jestli se vybuilduji i akce ktere se vykonavaji v index.js, nebo snad jestli se builduji jenom veci pouzite v index.js a nic jineho?

@pohadkar
Copy link
Collaborator Author

tak po testech s upravou index.js a novem buildu se ukazalo, ze na tom, co je v index.js sakra zalezi. :)

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

1 participant