Configuration: Assets
Pakyow provides the following application config options for assets:
assets.cache
: Iftrue
, cache headers will be set on responses to asset requests. Default:false
;true
in productionassets.fingerprint
: Iftrue
, assets will be fingerprinted based on their contents. Default:false
;true
in productionassets.minify
: Iftrue
, assets that support minification will be minified. Default:false
;true
in productionassets.process
: Iftrue
, assets will be processed at request time. Default:true
;false
in productionassets.public
: Iftrue
, any file found inpublic_path
will be served. Default:true
assets.silent
: Iftrue
, asset requests will not be logged. Default:true
;false
in productionassets.prefix
: Root path that assets are requested from. Default:"/assets"
assets.public_path
: Where to serve public. Default:"{root}/public"
assets.compile_path
: Where assets will be compiled to. Default:"{root}/public"
assets.path
: Where to find assets. Default:"{presenter.path}/assets"
assets.types
: All of the supported asset types. Default:{ av: [".webm", ".snd", ".au", ".aiff", ".mp3", ".mp2", ".m2a", ".m3a", ".ogx", ".gg", ".oga", ".midi", ".mid", ".avi", ".wav", ".wave", ".mp4", ".m4v", ".acc", ".m4a", ".flac"], data: [".json", ".xml", ".yml", ".yaml"], fonts: [".eot", ".otf", ".ttf", ".woff", ".woff2"], images: [".ico", ".bmp", ".gif", ".webp", ".png", ".jpg", ".jpeg", ".tiff", ".tif", ".svg"], scripts: [".js"], styles: [".css", ".sass", ".scss"] }
Asset Packs
Pakyow provides the following application config options for asset packs:
assets.packs.path
: Where to find asset packs. Default:"{assets.path}/packs"
assets.packs.autoload
: Array of packs that added to every presented view. Default:[:pakyow, :application]
External Assets
Pakyow provides the following application config options for external assets:
assets.externals.fetch
: Iftrue
, external assets will be fetched at boot. Default:true
;false
in test and productionassets.externals.pakyow
: Iftrue
, Pakyow.js will be managed as an external asset. Default:true
assets.externals.provider
: Where to fetch external assets from. Default:"https://unpkg.com/"
assets.externals.path
: Where external assets live. Default:"{assets.packs.path}/vendor"
Example Usage
Asset config lives in config/application.rb
:
Pakyow.app do
configure do
config.assets.option = value
end
end