Asset Pipeline for Perl
Upcoming SlideShare
Loading in...5
×
 

Asset Pipeline for Perl

on

  • 2,860 views

Plack::Middleware::Assets::RailsLike

Plack::Middleware::Assets::RailsLike

Statistics

Views

Total Views
2,860
Views on SlideShare
1,051
Embed Views
1,809

Actions

Likes
1
Downloads
0
Comments
0

12 Embeds 1,809

http://blog.vitamin11.org 907
http://hokkaido.pm.org 811
http://8653813949780496014_f6f0ae1c8d4ca147c59413e78a27fc365af98d50.blogspot.com 40
http://cloud.feedly.com 23
https://twitter.com 15
https://www.google.co.jp 6
http://dev.nacworld.net 2
http://hokkaido.pm.org&_=1384128000015 HTTP 1
http://www.newsblur.com 1
http://ironman.enlightenedperl.org 1
http://www.goread.io 1
http://www.perl-hokkaido.org 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Asset Pipeline for Perl Asset Pipeline for Perl Presentation Transcript

  • Hokkaido.pm#10 LT @aloelight Asset Pipeline for Perl
  • Asset Pipeline •複数のJavaScriptやCSSを結合して、 minifyしたりしてくれる機能 •CoffeeScript、Sass等を自動で変換 •Railsに標準搭載されている
  • それっぽいの作りました Plack::Middleware::Assets::RailsLike github.com/ysasaki/p5-plack-middleware-assets-railslike
  • 主な機能 •JavaScript, CSSの結合と最小化 •LESS, Sass/Scssの展開 •Cache •Pre-compile
  • 使い方
  • ディレクトリ構造 . ├── app.psgi ├── assets │ ├── main.css │ └── main.js └── static ├── css │ ├── div.css │ └── style.css └── js ├── alert.js ├── functions.js └── jquery-2.0.3.js Manifestファイル 読み込ませたいファイルを記載 読み込みたい普通のjs, cssファイル
  • Manifest > cat assets/main.js //= require jquery-2.0.3 //= require functions //= require alert > cat assets/main.css /* *= require style *= require div */
  • app.psgi use strict; use warnings; use Plack::Builder; builder { enable 'Assets::RailsLike', path        => qr{^/assets}, root        => '.', search_path => [ './static/js', './static/css' ]; $app; };
  • DEMO
  • Pre-compile > assets-railslike-precompiler.pl -v > --search-path static/js > assets/main.js Compiles assets/main.js => assets/ main-1078b9553ce7343a23b915716b84d68bf5c72d64.js
  • DEMO