複数のエントリポイントから共通して利用されているベンダモジュールを外出し

This commit is contained in:
hina 2019-03-08 06:53:13 +09:00
parent e8438a78a1
commit 94c19235b6
No known key found for this signature in database
GPG Key ID: 6136D5E22A0EE24B
4 changed files with 10 additions and 4 deletions

View File

@ -104,5 +104,6 @@
@push('script') @push('script')
<script id="global-count-labels" type="application/json">@json(array_keys($globalEjaculationCounts))</script> <script id="global-count-labels" type="application/json">@json(array_keys($globalEjaculationCounts))</script>
<script id="global-count-data" type="application/json">@json(array_values($globalEjaculationCounts))</script> <script id="global-count-data" type="application/json">@json(array_values($globalEjaculationCounts))</script>
<script src="{{ mix('js/vendor/chart.js') }}"></script>
<script src="{{ mix('js/home.js') }}"></script> <script src="{{ mix('js/home.js') }}"></script>
@endpush @endpush

View File

@ -217,6 +217,8 @@
</div> </div>
</div> </div>
@endguest @endguest
<script src="{{ mix('js/manifest.js') }}"></script>
<script src="{{ mix('js/vendor.js') }}"></script>
<script src="{{ mix('js/app.js') }}"></script> <script src="{{ mix('js/app.js') }}"></script>
@stack('script') @stack('script')
</body> </body>

View File

@ -30,6 +30,7 @@
@endsection @endsection
@push('script') @push('script')
<script id="graph-data" type="application/javascript">@json($graphData)</script> <script id="graph-data" type="application/json">@json($graphData)</script>
<script src="{{ mix('js/vendor/chart.js') }}"></script>
<script src="{{ mix('js/user/stats.js') }}"></script> <script src="{{ mix('js/user/stats.js') }}"></script>
@endpush @endpush

2
webpack.mix.js vendored
View File

@ -21,6 +21,8 @@ mix.js('resources/assets/js/app.js', 'public/js')
.autoload({ .autoload({
'jquery': ['$', 'jQuery', 'window.jQuery'] 'jquery': ['$', 'jQuery', 'window.jQuery']
}) })
.extract(['jquery', 'bootstrap'])
.extract(['chart.js', 'moment'], 'public/js/vendor/chart')
if (process.argv.includes('-a')) { if (process.argv.includes('-a')) {
mix.bundleAnalyzer({analyzerMode: 'static'}); mix.bundleAnalyzer({analyzerMode: 'static'});