2017 © Pedro PelĂĄez
 

october-plugin webpackassets-plugin

Webpack hashed files in October CMS

image

castiron/webpackassets-plugin

Webpack hashed files in October CMS

  • Thursday, May 10, 2018
  • by gblair
  • Repository
  • 8 Watchers
  • 4 Stars
  • 1,044 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 10 Versions
  • 10 % Grown

The README.md

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., (*1)

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., (*2)

Installation

composer require castiron/webpackassets-plugin

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.):, (*3)

[webpackAssets]
==


{{ webpackAssets.tag('unhashed_filename.woff2') | raw }}


{{ webpackAssets.tag('unhashed_filename.css') | raw }}

[webpackAssets]
==


{{ webpackAssets.tag('unhashed_filename.js') | raw }}
{{ webpackAssets.tag('webpack-dev-server.js') | raw }}

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.), (*4)

Component options

publicFolder (default: "www"), (*5)

If you are using a public folder in OctoberCMS (you should be!), specify it here. E.g. "www" or "public", (*6)

[webpackAssets]
publicFolder = public

assetsFolder (default: "assets"), (*7)

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., (*8)

[webpackAssets]
assetsFolder = assets

manifestFilename (default: "manifest.json", must be relative to assetsFolder), (*9)

[webpackAssets]
manifestFilename = files.json

Changelog

2.0.3

  • October 1.1 compatible

The Versions

10/05 2018

dev-master

9999999-dev https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack

10/05 2018

2.0.0

2.0.0.0 https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack

23/04 2018

dev-json

dev-json https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack

07/02 2018

1.0.6

1.0.6.0 https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack

07/02 2018

dev-nr/php-addon

dev-nr/php-addon https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack

02/08 2017

1.0.5

1.0.5.0 https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack

18/05 2017

1.0.4

1.0.4.0 https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack

18/05 2017

1.0.3

1.0.3.0 https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack

18/05 2017

1.0.2

1.0.2.0 https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack

18/05 2017

1.0.1

1.0.1.0 https://github.com/castiron/webpackassets-plugin

Webpack hashed files in October CMS

  Sources   Download

MIT

The Requires

 

october octobercms webpack