Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 1.48 KB

README.md

File metadata and controls

43 lines (26 loc) · 1.48 KB

📱 SensorWeb Website

To develop:

  1. npm install
  2. npm run dev -- this launches a development server at http://localhost:9000/webpack-dev-server/ which automatically builds and reloads. (Note: it says that it serves from ./dist, but it does not.)

To make a production build:

  1. npm run prod -- this puts a built static directory in ./dist, which is directly uploaded to S3 to serve the site.

Notes for Engineers

Libraries

We use the following technologies:

Styles / CSS

Our CSS includes a few global resets for ease of use:

  • "box-sizing: border-box" is default.
  • All margin and padding is removed from all elements.
  • All font size and weights are reset.

All styles are defined in the same file as their owning component, defined with styled-components. This allows us to avoid CSS rot.

Assets / Images

Assets (images, etc.) are included in the src/assets folder and referenced by requiring them in modules like so:

<img src={require<string>('./assets/foo.png')} />

Under the hood, Webpack copies that file to the output directory using an opaque name. Files which are not referenced are not included in the output; this avoids bundling unused files.