Coder Social home page Coder Social logo

evax's Introduction

Evax Assets Compressor

Evax compressor logo

Evax compressor make you feel lighter

Evax is a simple asset packaging library for Ruby, providing JavaScript/CSS concatenation and compression using UglifyJS and a really simple regex based CSS compressor. Just because enough is enough.

The idea behind it is to have a really simple library to compress your assets in the simplest way without any weird dependency (who said Java?). There are nice assets packaging systems out there but they have too many options for some cases.

Create a YAML file describing assets, Evax will take it and compress the javascript and stylesheets files to the output directory of your choice. Done.

Instalation

gem install evax

Dependencies

As Evax has a dependency in uglifier who has a dependency in execjs it is needed to have a proper JS runtime installed in your system. Pick one from the execjs README page

Usage

assets.yml

compress:    off # default on
output_path: tmp/

javascripts:
  js_package_one:
    - test/fixtures/javascripts/one.js
    - test/fixtures/javascripts/two.js
    - test/fixtures/javascripts/three.js
  js_package_two:
    - test/fixtures/javascripts/four.js

stylesheets:
  css_package_one:
    - test/fixtures/stylesheets/one.css
    - test/fixtures/stylesheets/two.css
  css_package_two:
    - test/fixtures/stylesheets/three.css
    - test/fixtures/stylesheets/four.css

Command Line

evax /path/to/assets.yml /base/path

Rails

Add evax to your Gemfile:

gem 'evax'

Create a Rake task for running it, e.g.:

namespace :evax do
  ASSETS_PATH = "#{Rails.root}/config/assets.yml"
  BASE_PATH   = Rails.root

  desc 'Build assets'
  task :build do
    Evax.new( ASSETS_PATH, BASE_PATH ).build
  end
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.