Skip to content

Commit

Permalink
JS: enable vendor code spliting, so browsers can cache vendor code be…
Browse files Browse the repository at this point in the history
…tween deploys.
  • Loading branch information
nedbaldessin committed Jan 13, 2020
1 parent e71de9f commit f6d7635
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
/public/css/app.css
/public/js/app.js
/public/js/bootstrap.js
/public/js/vendor.js
/public/js/manifest.js
/public/js/bootstrap.js.LICENSE
/public/js/vendor.js.LICENSE
/public/mix-manifest.json
/public/media
/public/sitemap*
Expand Down
2 changes: 2 additions & 0 deletions resources/views/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ function getOriginalVisitorCookieTimeout() {
<script crossorigin="anonymous"
src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver">
</script>
<script src="{{ mix('js/manifest.js') }}"></script>
<script src="{{ mix('js/vendor.js') }}"></script>
<script src="{{ mix('js/bootstrap.js') }}"></script>

@yield('end_body')
Expand Down
3 changes: 2 additions & 1 deletion webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ mix
host: "127.0.0.1",
port: 8080
}
});
})
.extract(); // Auto-magically split out vendor JS.

if (mix.inProduction()) {
mix.version();
Expand Down

0 comments on commit f6d7635

Please sign in to comment.