Skip to content

Commit

Permalink
feat!: do not use manifest in dev or test environments (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
flick36 authored Jan 16, 2022
1 parent b87ac2d commit 590c034
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Vite.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ protected function shouldUseManifest(): bool
return false;
}

if (! App::environment('local')) {
if (! App::environment(['local', 'testing'])) {
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/ViteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@

Config::set('vite.entrypoints', 'scripts');
App::setBasePath(__DIR__);
set_env('production');
expect(get_vite()->getClientAndEntrypointTags())
->toEqual('<script type="module" src="https://cdn.random.url/build/app.83b2e884.js"></script>');
});
Expand All @@ -136,6 +137,7 @@
'https://cdn.random.url'
));

set_env('production');
expect(vite_asset('image.png'))->toBe('https://cdn.random.url/build/image.png');
});

Expand Down

0 comments on commit 590c034

Please # to comment.