gassetic
Symfony2 Assetic replacement based on the gulp build tool
Last updated 4 years ago by schero .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gassetic 
SYNC missed versions from official npm registry.

Gassetic build status

Summary

Gassetic is an Assetic replacement which is based on the gulp build tool for more comfortable frontend development and dependency management

Advantages over assetic

  • Easy to setup
  • Use a package manager like Bower or Npm for JS dependencies
  • Use the gulp.js ecosystem to build your frontend assets
  • Use gulp-livereload for CSS hot reloading (see the CSS section in the example below)

How it works

Gassetic makes it easy to manage your frontend assets. You can install JS and CSS libs through a package manager like Bower and then compile them using tools from gulp.js

Gassetic replaces "<!-- {env}:{filename} --><!-- endbuild -->" strings in your templates with your generated CSS and JS files. In your gassetic.yml file you can specify which files and tasks to run on the input files and the names of the output files.

Gulp has literally hundreds of plugins that you can include in your gulpfile and process on your frontend assets.

Installation

  1. Create your gassetic config

yaml example with gassetic.yml

requires:
  less: gulp-less
  minify: gulp-minify-css
  concat: gulp-concat
  uglify: gulp-uglify
  livereload: gulp-livereload
mimetypes:
  # This section contains the formatters for the css files
  css:
    # In 'prod' mode, use these settings
    prod:
      outputFolder: web/compiled/css  # The output folder for your saving your compiled files
      webPath:      /compiled/css     # The web path for the compiled files
      # Run these tasks on your compiled files
      tasks:
        - { name: less }
        - { name: minify }
        - { name: concat, args: '%filename%' }
        - { name: livereload, args: { start: true } }
      htmlTag: '<link rel="stylesheet" type="text/css" href="{{ asset("%path%") }}">' # custom html tag

    # This is the list of source files to apply the above settings
    files:
      frontend.css: # This is the output filename
        - assets/css/animate.min.css
        - assets/css/swipebox.css
        - assets/vendor/bootstrap-daterangepicker/daterangepicker-bs3.css
        - assets/vendor/bootstrap3-wysihtml5-bower/dist/bootstrap3-wysihtml5.css
        - assets/vendor/jquery-simplecolorpicker/jquery.simplecolorpicker.css
        - vendors/oh/emoji-bundle/Oh/EmojiBundle/vendor/emoji.css
      backend.css:
        - assets/vendor/bootstrap-daterangepicker/daterangepicker-bs3.css
        - assets/css/backend.css

    # Watch these files for changes (optional)
    watch:
      - assets/**/*.less
      - assets/**/*.css

  # This section contains the formatters for your JS files
  js:
    prod:
      outputFolder: web/compiled/js  # Save the files here
      webPath:      /compiled/js     # Specify the web path
      tasks:
        - { name: concat, args: '%filename%' }
        - { name: uglify, args: { mangle: false } }

    # Here is a list of files to apply the above tasks to
    files:
      jquery.js: # This is the output filename
        - assets/vendor/jquery/jquery.js
      app.js:
        - web/html5lightbox/html5lightbox.js
        - assets/vendor/angular/angular.js
        - assets/vendor/angular-route/angular-route.js
        - assets/vendor/angular-sanitize/angular-sanitize.js
        - assets/js/tmp/angularApp.js/**/*.js

# This is the list of files/paths to search and find the replacement tags to insert the
# generated <script> or stylesheet tags
replacementPaths:
  - web/*.html
  - includes/**/*.html

default:
  - js
  - css
  1. Within root of your project run:

npm install gulp-less npm install gulp-minify-css npm install gulp-uglify npm install gulp-concat ... else that you need and have defined in the 'requires' section of the config

  1. Update your templates from
<link rel="stylesheet" ...

To:

The strings "" will be searched for in the 'replacementPaths' list in the settings and replaced with the generated tags and files

  1. install gassetic npm install -g gassetic

  2. run gassetic for watching and livereloading the files

  3. run gassetic build --env=prod for production build

  4. run gassetic build --env=custom for custom build

Done.

More docs

Contributions

Launch tests

npm install
npm test

The MIT License (MIT)

Copyright (c) 2014 Roman Schejbal

Donate: 1K4HAJqnh8PPomJj47vWNP3GPNF2LE2FEt

Current Tags

  • 1.0.10                                ...           latest (3 years ago)

41 Versions

  • 1.0.10                                ...           3 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.4.2                                ...           4 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.4                                ...           5 years ago
  • 0.3.3                                ...           6 years ago
  • 0.3.2                                ...           6 years ago
  • 0.3.1                                ...           6 years ago
  • 0.3.0                                ...           6 years ago
  • 0.2.4                                ...           6 years ago
  • 0.2.3                                ...           6 years ago
  • 0.2.2                                ...           6 years ago
  • 0.2.1                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.14                                ...           6 years ago
  • 0.0.13                                ...           6 years ago
  • 0.0.12                                ...           6 years ago
  • 0.0.11                                ...           6 years ago
  • 0.0.10                                ...           6 years ago
  • 0.0.9                                ...           6 years ago
  • 0.0.8                                ...           6 years ago
  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
  • 0.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (13)
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |