tissue/webpack.mix.js

41 lines
1.5 KiB
JavaScript
Raw Normal View History

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.
|
*/
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')
.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
})
.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) => ({
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
}