2020-08-06 01:05:33 +09:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
2019-03-08 06:52:29 +09:00
|
|
|
const mix = require('laravel-mix');
|
2020-08-06 01:05:33 +09:00
|
|
|
require('laravel-mix-bundle-analyzer');
|
2017-08-27 04:44:53 +09:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Mix Asset Management
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Mix provides a clean, fluent API for defining some Webpack build steps
|
|
|
|
| for your Laravel application. By default, we are compiling the Sass
|
|
|
|
| file for the application as well as bundling up all the JS files.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2020-06-06 16:14:11 +09:00
|
|
|
mix.ts('resources/assets/js/app.ts', 'public/js')
|
|
|
|
.ts('resources/assets/js/home.ts', 'public/js')
|
|
|
|
.ts('resources/assets/js/user/profile.ts', 'public/js/user')
|
|
|
|
.ts('resources/assets/js/user/stats.ts', 'public/js/user')
|
|
|
|
.ts('resources/assets/js/setting/privacy.ts', 'public/js/setting')
|
|
|
|
.ts('resources/assets/js/setting/import.ts', 'public/js/setting')
|
|
|
|
.ts('resources/assets/js/setting/deactivate.ts', 'public/js/setting')
|
2020-08-13 00:38:26 +09:00
|
|
|
.ts('resources/assets/js/checkin.tsx', 'public/js')
|
2019-03-05 00:06:04 +09:00
|
|
|
.sass('resources/assets/sass/app.scss', 'public/css')
|
|
|
|
.autoload({
|
2020-08-06 01:05:33 +09:00
|
|
|
jquery: ['$', 'jQuery', 'window.jQuery'],
|
2019-03-08 06:52:29 +09:00
|
|
|
})
|
2019-03-08 06:53:13 +09:00
|
|
|
.extract(['jquery', 'bootstrap'])
|
2020-06-06 07:11:56 +09:00
|
|
|
.extract(['chart.js', 'chartjs-color', 'color-name', 'moment', 'cal-heatmap', 'd3'], 'public/js/vendor/chart')
|
2020-06-06 06:37:39 +09:00
|
|
|
.version()
|
2020-08-06 01:27:47 +09:00
|
|
|
.sourceMaps(false)
|
2020-08-06 01:05:33 +09:00
|
|
|
.webpackConfig((_webpack) => ({
|
2020-06-06 15:38:40 +09:00
|
|
|
externals: {
|
2020-08-06 01:05:33 +09:00
|
|
|
moment: 'moment',
|
|
|
|
},
|
2020-06-06 06:41:57 +09:00
|
|
|
}));
|
2019-03-08 06:52:29 +09:00
|
|
|
|
|
|
|
if (process.argv.includes('-a')) {
|
2020-06-06 06:41:57 +09:00
|
|
|
mix.bundleAnalyzer({ analyzerMode: 'static' });
|
2019-03-08 06:52:29 +09:00
|
|
|
}
|