Skip to content

Commit

Permalink
Merge branch 'skore/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 12, 2021
2 parents 10b7419 + efe3f76 commit 8f4e7c2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/ApplicationFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public static function get($path)
->exclude('.idea')
->exclude('.vapor')
->notPath('/^'.preg_quote('tests', '/').'/')
->exclude('node_modules')
->ignoreVcs(true)
->ignoreDotFiles(false);
}
Expand Down
19 changes: 18 additions & 1 deletion src/BuildProcess/CopyApplicationToBuildPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Laravel\VaporCli\ApplicationFiles;
use Laravel\VaporCli\Helpers;
use Laravel\VaporCli\Manifest;
use SplFileInfo;

class CopyApplicationToBuildPath
Expand All @@ -21,7 +22,7 @@ public function __invoke()

$this->ensureBuildDirectoryExists();

foreach (ApplicationFiles::get($this->path) as $file) {
foreach ($this->getApplicationFiles() as $file) {
if ($file->isLink()) {
continue;
}
Expand All @@ -35,6 +36,22 @@ public function __invoke()
$this->flushStorageDirectories();
}

/**
* Get the included application files.
*
* @return \Symfony\Component\Finder\Finder
*/
public function getApplicationFiles()
{
$files = ApplicationFiles::get($this->path);

if (Manifest::excludeNodeModules()) {
$files->exclude('node_modules');
}

return $files;
}

/**
* Create a directory for the application copy operation.
*
Expand Down
15 changes: 15 additions & 0 deletions src/Manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,24 @@ public static function buildCommands($environment)
public static function ignoredFiles()
{
return static::current()['ignore'] ?? [];

// return static::current()['environments'][$environment]['ignore'] ?? [];
}

/**
* Determine if we should exclude the node_modules directory.
*
* @return bool
*/
public static function excludeNodeModules()
{
if (isset(static::current()['exclude-node-modules'])) {
return static::current()['exclude-node-modules'];
}

return true;
}

/**
* Determine if we should separate the vendor directory.
*
Expand Down

0 comments on commit 8f4e7c2

Please sign in to comment.