tissue/webpack.mix.js

39 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-03-08 06:52:29 +09:00
const mix = require('laravel-mix');
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.
|
*/
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')
2019-05-24 01:08:47 +09:00
.ts('resources/assets/js/checkin.ts', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.autoload({
'jquery': ['$', 'jQuery', 'window.jQuery']
2019-03-08 06:52:29 +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-06-06 06:41:57 +09:00
.webpackConfig(webpack => ({
externals: {
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
}