Get correct asset paths from Parcel when using Parcel Manifest.
This plugin requires Craft CMS 3.0.0-beta.23 or later.
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require heggemsnes/parcel-twig
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for ParcelTwig.
Simple plugin for extracting correct asset path from parcel-manifest.json when using parcel. Check out https://github.com/kult-byra/parcel-craft-docker for usecase.
You can change the path to the parcel-manifest.json file as well as to your dist folder in the settings.
Use the twig function {{asset("index.js")}} to generate a script tag linking to i.e. js.00a46daa.js bundle.
Brought to you by Sigurd Heggemsnes