Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e9f7f04

Browse filesBrowse files
author
Andrey Helldar
authored
#53 Removed development compile with npm/yarn
1 parent 06823d5 commit e9f7f04
Copy full SHA for e9f7f04

File tree

Expand file treeCollapse file tree

1 file changed

+7
-24
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-24
lines changed

‎src/LaravelDeployer/Commands/DeployInit.php

Copy file name to clipboardExpand all lines: src/LaravelDeployer/Commands/DeployInit.php
+7-24Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -145,26 +145,15 @@ public function defineAdditionalHooks()
145145
[
146146
'No',
147147
'Yes using `npm run production`',
148-
'Yes using `npm run development`',
149148
'Yes using `yarn production`',
150-
'Yes using `yarn development`',
151149
], 1
152150
);
153-
154-
if ($npm === 'Yes using `npm run production`') {
155-
$this->addHooksCompileAssets('npm', 'production');
156-
}
157-
158-
if ($npm === 'Yes using `npm run development`') {
159-
$this->addHooksCompileAssets('npm', 'development');
160-
}
161-
162-
if ($npm === 'Yes using `yarn production`') {
163-
$this->addHooksCompileAssets('yarn', 'production');
164-
}
165-
166-
if ($npm === 'Yes using `yarn development`') {
167-
$this->addHooksCompileAssets('yarn', 'development');
151+
152+
if ($npm !== 'No') {
153+
$manager = $npm === 'Yes using `npm run production`' ? 'npm' : 'yarn';
154+
$this->builder->add('hooks.build', "$manager:install");
155+
$this->builder->add('hooks.build', "$manager:production");
156+
168157
}
169158

170159
if ($this->confirm('Do you want to migrate during deployment?', true)) {
@@ -175,10 +164,4 @@ public function defineAdditionalHooks()
175164
$this->builder->add('hooks.ready', 'artisan:horizon:terminate');
176165
}
177166
}
178-
179-
private function addHooksCompileAssets($manager, $environment)
180-
{
181-
$this->builder->add('hooks.build', "$manager:install");
182-
$this->builder->add('hooks.build', "$manager:$environment");
183-
}
184-
}
167+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.