A plugin that provides https://github.com/fullpipe/twig-webpack-extension
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 OscarBarrett/craft-twig-webpack-extension
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Twig Webpack Extension.
Create a file at craft/config/twig-webpack-extension.php
.
If your assets and manifest are in the same directory, simply set outputDir
:
return [
'outputDir' => '<outputDir>'
];
Alternatively, you can set each parameter separately:
return [
'manifestPath' => <outputDir>/manifest.json',
'jsPath' => '<jsOutputDir>/',
'cssPath' => '<cssOutputDir>/'
];
The plugin can also be configured from the CMS.