Airdrop — Speed up your Laravel deployments by skipping asset compilation.
A package by Hammerstone

File Trigger

The File Trigger keeps track of specific files and instructs Airdrop to rebuild assets when any of them change.

config/airdrop.php

1/*
2 * Trigger a rebuild when files change.
3 */
4FileTrigger::class => [
5 /*
6 * Files or folders that should be included.
7 */
8 'include' => [
9 // By default we include every file in your resource path. Usually
10 // this makes the most sense and doesn't need to be changed.
11 resource_path(),
12
13 // Any time the webpack.mix.js file is changed, it could affect the
14 // the build steps, and therefore the built files.
15 base_path('webpack.mix.js'),
16
17 // Depending on your package manager, you'll want to uncomment one
18 // of the following lines. Whenever JS packages are updated or
19 // removed, the assets will need to be rebuilt.
20 // base_path('yarn.lock'),
21 // base_path('package-lock.json'),
22
23 // If you use NVM to manage your node versions, you'll want to
24 // rebuild your assets anytime the node version changes.
25 // base_path('.nvmrc'),
26
27 // If you use Tailwind, uncomment the following line. Changing your
28 // Tailwind config will change the CSS files that are generated.
29 // base_path('tailwind.config.js'),
30 ],
31
32 /*
33 * Files or folders that should be excluded or ignored.
34 */
35 'exclude' => [
36 //
37 ],
38]

Including & Excluding

The File Trigger allows both an include and exclude key, so if you want to include a whole directory and exclude a particular file, you can do that:

config/airdrop.php

1FileTrigger::class => [
2 'include' => [
3 resource_path(),
4 ],
5
6 'exclude' => [
7 resource_path('file-to-be-ignored.blade.php'),
8 ],
9]

Asset Package Managers

If you're using NPM to manage your frontend packages, you'll want to include package-lock.json so that whenever you add, remove, or upgrade packages then Airdrop will rebuild your assets.

config/airdrop.php

1FileTrigger::class => [
2 'include' => [
3 resource_path(),
4 'package-lock.json'
5 ],
6]

In the same way, if you're using Yarn, add yarn.lock.

config/airdrop.php

1FileTrigger::class => [
2 'include' => [
3 resource_path(),
4 'yarn.lock'
5 ],
6]

Tailwind CSS

If you're using Tailwind CSS, make sure you include that as well, as any changes to the Tailwind config will affect the resulting assets.

config/airdrop.php

1FileTrigger::class => [
2 'include' => [
3 resource_path(),
4 'tailwind.config.js'
5 ],
6]