2021-09-26 15:25:58 +02:00
|
|
|
<!-- DO NOT EDIT THIS FILE! -->
|
|
|
|
<!-- Instead edit contrib/webpack_encore.php -->
|
|
|
|
<!-- Then run bin/docgen -->
|
|
|
|
|
2022-07-26 09:18:44 +02:00
|
|
|
# Webpack Encore Recipe
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
[Source](/contrib/webpack_encore.php)
|
|
|
|
|
2021-11-06 19:02:51 +01:00
|
|
|
* Requires
|
|
|
|
* [npm](/docs/contrib/npm.md)
|
|
|
|
* [yarn](/docs/contrib/yarn.md)
|
|
|
|
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
## Installing
|
|
|
|
|
|
|
|
Add to your _deploy.php_
|
|
|
|
|
|
|
|
```php
|
|
|
|
require 'contrib/webpack_encore.php';
|
|
|
|
```
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
- **webpack_encore/package_manager** *(optional)*: set yarn or npm. We try to find if yarn or npm is available and used.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```php
|
|
|
|
For Yarn
|
|
|
|
after('deploy:update_code', 'yarn:install');
|
|
|
|
For npm
|
|
|
|
after('deploy:update_code', 'npm:install');
|
|
|
|
|
|
|
|
after('deploy:update_code', 'webpack_encore:build');
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2021-10-18 18:29:14 +02:00
|
|
|
## Configuration
|
|
|
|
### webpack_encore/package_manager
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/contrib/webpack_encore.php#L31)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### webpack_encore/env
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/contrib/webpack_encore.php#L39)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```php title="Default value"
|
|
|
|
'production'
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
## Tasks
|
|
|
|
|
|
|
|
### webpack_encore:build
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/contrib/webpack_encore.php#L42)
|
|
|
|
|
2021-11-08 22:59:39 +01:00
|
|
|
Runs webpack encore build.
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|