Download the PHP package castiron/webpackassets-plugin without Composer
On this page you can find all versions of the php package castiron/webpackassets-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download castiron/webpackassets-plugin
More information about castiron/webpackassets-plugin
Files in castiron/webpackassets-plugin
Package webpackassets-plugin
Short Description Webpack hashed files in October CMS
License MIT
Homepage https://github.com/castiron/webpackassets-plugin
Informations about the package webpackassets-plugin
Webpack Assets in October CMS
This plugin for OctoberCMS works in tandem with the node package webpack-assets-manifest
(https://github.com/webdeveric/webpack-assets-manifest) to include CSS, JS, and font assets
in your site based on a JSON manifest file written to your assets directory. This will allow you to use hashed file
names in your built files, and let October pick up the paths effortlessly.
In non-development environments (when the APP_ENV environment variable doesn't equal "dev") these paths get cached
so the JSON file isn't read on every request. This cache should be cleared as a part of the deploy process by running
php artisan cache:clear
.
Installation
Quick start
This plugin provides a component called webpackAssets
. Include the component in your view and then use the following
to include the js/css/fonts (WOFF2 only) in your template (e.g. in a partial, layout, etc.):
Keep in mind that there’s a performance trade-off to preloading too many font assets, so limit your use to only the highest-priority font assets. For the same reason, the plugin will only create tags for the WOFF2 font format. (See “The Critical Request” and “The Web Fonts: Preloaded” for more information.)
Component options
publicFolder
(default: "www")
If you are using a public folder in OctoberCMS (you should be!), specify it here. E.g. "www" or "public"
assetsFolder
(default: "assets")
The path to the folder, relative to your public folder, to which webpack is writing your assets. This
corresponds to output.path
from your webpack config.
manifestFilename
(default: "manifest.json", must be relative to assetsFolder)
Changelog
2.0.3
- October 1.1 compatible