You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# How to compile assets on deploy using npm (or yarn)?
2
2
3
-
The recipe`recipe/npm.php`is already required within Laravel Deployer's recipe. Therefore, all you need to do is hook the `npm` tasks in you deployment flow.
3
+
The recipes`recipe/npm.php`and `recipe/yarn.php` are already required within Laravel Deployer's recipe. Therefore, all you need to do is hook the relevant tasks in you deployment flow.
4
4
5
5
```php
6
6
// config/deploy.php
7
7
8
8
'hooks' => [
9
9
'build' => [
10
-
'npm:install',
11
-
'npm:production',
10
+
'npm:install', // or yarn:install
11
+
'npm:production', // or yarn:production
12
12
],
13
13
],
14
14
```
@@ -19,4 +19,7 @@ The recipe `recipe/npm.php` is already required within Laravel Deployer's recipe
19
19
| - | - |
20
20
|`npm:install`| Copy the `node_modules` folder from the previous release if it exists, and run `npm install`. |
21
21
|`npm:development`| Compile your assets using `npm run develoment`. |
22
-
|`npm:production`| Compile your assets using `npm run production`. |
22
+
|`npm:production`| Compile your assets using `npm run production`. |
23
+
|`yarn:install`| Copy the `node_modules` folder from the previous release if it exists, and run `yarn install`. |
24
+
|`yarn:development`| Compile your assets using `yarn develoment`. |
25
+
|`yarn:production`| Compile your assets using `yarn production`. |
0 commit comments