Skip to content

Latest commit

 

History

History
78 lines (70 loc) · 5.09 KB

development.md

File metadata and controls

78 lines (70 loc) · 5.09 KB

Helpful notes about deployment.

Development

How to Setup blowdrycss (optional tool for rapidly styling the frontend)

  • Activate project virtual environment
  • pip install blowdrycss
  • Navigate to project folder.
  • Run blowdrycss
  • Open the newly created blowdrycss_settings.py file.
  • Change the following variable to match these values:
  • project_directory = path.join(cwd, 'templates')
  • css_directory = path.join(cwd, 'static', 'scss')
  • output_file_name = '_blowdry'
  • output_extension = '.scss'
  • auto_generate = True
  • human_readable = True
  • minify = False
  • Go to the px_to_em() function
  • Find this line em = str(em) + 'em'
  • Change to this em = str(em) + 'rem'

Prerequisite for npm powered automation

  • Install node package manager (npm) on your machine.
  • Place npm on the system path.

Setup Sass and SCSS Transpiler

Combine Javascript files into one and minify with uglifyjs

Setup auto-minify CSS using node.js yuicompress

Setup node-zopfli to compress combined CSS and JS files for Production

  • Zopfli Compresses gzip files 5% better than gzip. To achieve the 5% it takes 100x longer than gzip. That is fine for us since we are not doing on-the-fly or just-in-time compression. https://www.npmjs.com/package/node-zopfli
  • Requires Python 2.7 and either GCC (Unix) or Visual Studio Express (Windows)
  • To install gcc on Windows via MinGW use this https://yichaoou.github.io/tutorials/software/2016/06/28/git-bash-install-gcc
  • Open command line as Administrator.
  • Run npm install -g node-zopfli
  • Run npm list -g --depth=0 to confirm installation.
  • Navigate to /npm/node_modules/node-zopfli/zopfli on your machine.
  • Run gcc src/zopfli/*.c -O2 -W -Wall -Wextra -Wno-unused-function -ansi -pedantic -lm -o zopfli
  • On ubuntu you can use apt-get install zopfli
  • An executable file named zopfli (linux) or zopfli.exe (windows) should now appear in your folder.
  • Setup two Custom File Watchers with zopfli for CSS and JS. Use combined.min.css and combined.js (production)
  • Configuring File Watcher output path http://stackoverflow.com/a/36038914/1783439

Testing with Flask-Testing, Selenium, Google chromedriver, Mozilla geckodriver