Your SlideShare is downloading. ×
Asset Pipeline for Perl
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Asset Pipeline for Perl

2,747
views

Published on

Plack::Middleware::Assets::RailsLike

Plack::Middleware::Assets::RailsLike

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,747
On Slideshare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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