diff --git a/src/RoboFileBase.php b/src/RoboFileBase.php index 5546a93..1da12f9 100644 --- a/src/RoboFileBase.php +++ b/src/RoboFileBase.php @@ -150,23 +150,25 @@ protected function buildTask($archivename = null) { $archive = is_null($archivename) ? $this->time . '.tar.gz' : $archivename; $collection = $this->collectionBuilder(); - $collection - ->taskThemeCompile() - ->taskExec($this->findExecutable('yarn') . ' run encore production') - ->taskThemeClean() - ->taskPackageProject($archive) - ->ignoreFileNames([ - '.gitattributes', - '.gitignore', - '.gitkeep', - 'README', - 'README.txt', - 'README.md', - 'LICENSE', - 'LICENSE.txt', - 'LICENSE.md', - 'phpunit.xml.dist' - ]); + if (file_exists('package.json')) { + $collection + ->taskThemeCompile() + ->taskExec($this->findExecutable('yarn') . ' run encore production') + ->taskThemeClean(); + } + $collection->taskPackageProject($archive) + ->ignoreFileNames([ + '.gitattributes', + '.gitignore', + '.gitkeep', + 'README', + 'README.txt', + 'README.md', + 'LICENSE', + 'LICENSE.txt', + 'LICENSE.md', + 'phpunit.xml.dist' + ]); return $collection; }