smthdiff/craft-encore

Helper plugin for Webpack Encode in Craft CMS templates

Installs: 20

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:craft-plugin

1.0.0 2020-11-24 18:22 UTC

This package is auto-updated.

Last update: 2024-04-25 02:54:25 UTC


README

Requirements

This plugin requires Craft CMS 3.0.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:
cd /path/to/project
  1. Then tell Composer to load the plugin:
composer require smthdiff/craft-encore
  1. In the Craft Control Panel, go to Settings → Plugins and click the "Install" button for Webpack Encore.

Configuration

To configure Webpack Encore go to Settings → Plugins → Webpack Encore in the Craft Control Panel.

The available settings are:

  • Asset Path - The path of the asset directory where the project stores the source files
  • Build Path - The path of the asset directory where Webpack Encore stores the compiled files

Usage of Asset Path

/assets/ in project root contains the CSS, JS, Images and Font Files.

Usage of Build Path

/web/build/ in project root contains the CSS, JS, Images and Font Files.

Usage

Add versioned CSS files.

{{ craft.encore.entryLinkTag('app') | raw }}

Add versioned JS files.

{{ craft.encore.entryScriptTag('app') | raw }}

License

Craft Encore is open-sourced software licensed under the MIT license.