luffykai / LM-PH2020

social housing map
0 stars 0 forks source link

How to add a component #32

Closed mw10104587 closed 4 years ago

mw10104587 commented 4 years ago
  1. Keep the babel compiler running with

    npx babel --watch src --out-dir ./public/javascripts/ --presets @babel/preset-react
  2. Add a component into ./src/components after saving, you can see new components saved into public/javascripts/components

  3. Use these components (like in LMAppRoot.react, or LMCountyRoot.react) which is automatically reference from main.js or county.js by specifying the chunk in the following diff.

  4. run npm run build and see that a new compiled .html and .js file is created in ./dist