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

Add front-end tools for development and production #41

Closed
JackMorganNZ opened this issue Feb 28, 2017 · 0 comments
Closed

Add front-end tools for development and production #41

JackMorganNZ opened this issue Feb 28, 2017 · 0 comments
Assignees
Labels
backend Related to the software powering the website

Comments

@JackMorganNZ
Copy link
Member

JackMorganNZ commented Feb 28, 2017

Using front-end tools can allow us to do the following:

  • Compile Sass into CSS, including autoprefixer support.
  • Compile JavaScript with Browserify.
  • Add sourcemaps for our compiled JavaScript and CSS.
  • Minify images with imagemin.
  • Reload the browser automatically on JavaScript (and/or template) changes.
  • Refresh the CSS without reloading the browser on CSS changes.
  • Trigger system notifications when Sass or JavaScript has errors.
  • Minify JavaScript and CSS for production deploy.

and finally:

  • Generate a build folder where all the generated files are stored.

From: https://lincolnloop.com/blog/integrating-front-end-tools-your-django-project/

These tasks are extremely useful, especially the compiling of SASS into CSS. Using SASS for this project is essentially a requirement for easier web development (especially as we plan to use the SASS files from Bootstrap 4 Alpha 6).

There are many options that I'm discovering on how to solve this issue (for both development and production), I've compile a list of links (which I'll keep adding to) of useful resources to read. Quotes are copied from product websites.

This issue replaces #27 #28, but may be effected by the choice in #38.

Django Packages

Django Compressor

Django Compressor processes, combines and minifies linked and inline Javascript or CSS in a Django template into cacheable static files. It supports compilers such as coffeescript, LESS and SASS and is extensible by custom processing steps.

Django Pipeline

Pipeline is an asset packaging library for Django, providing both CSS and JavaScript concatenation and compression, built-in JavaScript template support, and optional data-URI image and font embedding.

Comparison

Task Runners

Grunt

Why use a task runner?
In one word: automation. The less work you have to do when performing repetitive tasks like minification, compilation, unit testing, linting, etc, the easier your job becomes. After you've configured it through a Gruntfile, a task runner can do most of that mundane work for you—and your team—with basically zero effort.

Gulp

gulp is a toolkit for automating painful or time-consuming tasks in your development workflow, so you can stop messing around and build something. By preferring code over configuration, node best practices, and a minimal API surface - gulp makes things simple like never before.

Comparison

Webpack

webpack is a tool to build JavaScript modules in your application. To start using webpack from its cli or api, follow the Installation instructions. webpack simplifies your workflow by quickly constructing a dependency graph of your application and bundling them in the right order. webpack can be configured to customise optimisations to your code, to split vendor/css/js code for production, run a development server that hot-reloads your code without page refresh and many such cool features.

Comparison

Related Reading

@JackMorganNZ JackMorganNZ added the backend Related to the software powering the website label Feb 28, 2017
@JackMorganNZ JackMorganNZ added this to the Initial Deployment milestone Feb 28, 2017
This was referenced Feb 28, 2017
@JackMorganNZ JackMorganNZ self-assigned this Mar 3, 2017
dhlambert pushed a commit to dhlambert/cs-unplugged that referenced this issue Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to the software powering the website
Development

No branches or pull requests

2 participants