From 82bb10ae2463ab13250ef4dea5900a297db748db Mon Sep 17 00:00:00 2001 From: shibafu Date: Thu, 6 Aug 2020 01:05:33 +0900 Subject: [PATCH 1/3] =?UTF-8?q?SourceMap=E3=81=8C=E6=AC=B2=E3=81=97?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack.mix.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/webpack.mix.js b/webpack.mix.js index 6fe6635..1baf0c4 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -1,5 +1,6 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires const mix = require('laravel-mix'); -require('laravel-mix-bundle-analyzer') +require('laravel-mix-bundle-analyzer'); /* |-------------------------------------------------------------------------- @@ -22,17 +23,23 @@ mix.ts('resources/assets/js/app.ts', 'public/js') .ts('resources/assets/js/checkin.ts', 'public/js') .sass('resources/assets/sass/app.scss', 'public/css') .autoload({ - 'jquery': ['$', 'jQuery', 'window.jQuery'] + jquery: ['$', 'jQuery', 'window.jQuery'], }) .extract(['jquery', 'bootstrap']) .extract(['chart.js', 'chartjs-color', 'color-name', 'moment', 'cal-heatmap', 'd3'], 'public/js/vendor/chart') .version() - .webpackConfig(webpack => ({ + .webpackConfig((_webpack) => ({ externals: { - moment: 'moment' - } + moment: 'moment', + }, })); if (process.argv.includes('-a')) { mix.bundleAnalyzer({ analyzerMode: 'static' }); } + +if (!mix.inProduction()) { + mix.webpackConfig({ + devtool: 'source-map', + }); +} From 8f1a4d3e88a413a5ce50751d0d34a13c7da29a5b Mon Sep 17 00:00:00 2001 From: shibafu Date: Thu, 6 Aug 2020 01:26:11 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E3=81=93=E3=82=8C=E3=81=A7=E3=81=84?= =?UTF-8?q?=E3=81=91=E3=82=8B=E3=81=98=E3=82=83=E3=82=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack.mix.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webpack.mix.js b/webpack.mix.js index 1baf0c4..3e1a6dd 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -39,7 +39,5 @@ if (process.argv.includes('-a')) { } if (!mix.inProduction()) { - mix.webpackConfig({ - devtool: 'source-map', - }); + mix.sourceMaps(); } From 87c97d27a8d7837013b95006a459327a12f841d0 Mon Sep 17 00:00:00 2001 From: shibafu Date: Thu, 6 Aug 2020 01:27:47 +0900 Subject: [PATCH 3/3] generateForProduction: false --- webpack.mix.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/webpack.mix.js b/webpack.mix.js index 3e1a6dd..16ed4e0 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -28,6 +28,7 @@ mix.ts('resources/assets/js/app.ts', 'public/js') .extract(['jquery', 'bootstrap']) .extract(['chart.js', 'chartjs-color', 'color-name', 'moment', 'cal-heatmap', 'd3'], 'public/js/vendor/chart') .version() + .sourceMaps(false) .webpackConfig((_webpack) => ({ externals: { moment: 'moment', @@ -37,7 +38,3 @@ mix.ts('resources/assets/js/app.ts', 'public/js') if (process.argv.includes('-a')) { mix.bundleAnalyzer({ analyzerMode: 'static' }); } - -if (!mix.inProduction()) { - mix.sourceMaps(); -}