From bad55c99968f4476e841ebce11c9464261a63a9d Mon Sep 17 00:00:00 2001 From: Francisco Madeira Date: Sat, 19 Mar 2022 21:53:15 +0000 Subject: [PATCH] Use `.alias` method from `Mix` (#145) --- src/Console/InstallsInertiaStacks.php | 2 -- stubs/inertia-common/webpack.config.js | 9 --------- stubs/inertia-common/webpack.mix.js | 4 +++- 3 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 stubs/inertia-common/webpack.config.js diff --git a/src/Console/InstallsInertiaStacks.php b/src/Console/InstallsInertiaStacks.php index 6981041a1..d8b8864f8 100644 --- a/src/Console/InstallsInertiaStacks.php +++ b/src/Console/InstallsInertiaStacks.php @@ -73,7 +73,6 @@ protected function installInertiaVueStack() // Tailwind / Webpack... copy(__DIR__.'/../../stubs/inertia-common/tailwind.config.js', base_path('tailwind.config.js')); copy(__DIR__.'/../../stubs/inertia-common/webpack.mix.js', base_path('webpack.mix.js')); - copy(__DIR__.'/../../stubs/inertia-common/webpack.config.js', base_path('webpack.config.js')); copy(__DIR__.'/../../stubs/inertia-common/jsconfig.json', base_path('jsconfig.json')); copy(__DIR__.'/../../stubs/inertia-common/resources/css/app.css', resource_path('css/app.css')); copy(__DIR__.'/../../stubs/inertia-vue/resources/js/app.js', resource_path('js/app.js')); @@ -150,7 +149,6 @@ protected function installInertiaReactStack() // Tailwind / Webpack... copy(__DIR__.'/../../stubs/inertia-common/tailwind.config.js', base_path('tailwind.config.js')); copy(__DIR__.'/../../stubs/inertia-common/webpack.mix.js', base_path('webpack.mix.js')); - copy(__DIR__.'/../../stubs/inertia-common/webpack.config.js', base_path('webpack.config.js')); copy(__DIR__.'/../../stubs/inertia-common/jsconfig.json', base_path('jsconfig.json')); copy(__DIR__.'/../../stubs/inertia-common/resources/css/app.css', resource_path('css/app.css')); copy(__DIR__.'/../../stubs/inertia-react/resources/js/app.js', resource_path('js/app.js')); diff --git a/stubs/inertia-common/webpack.config.js b/stubs/inertia-common/webpack.config.js deleted file mode 100644 index 263ad347f..000000000 --- a/stubs/inertia-common/webpack.config.js +++ /dev/null @@ -1,9 +0,0 @@ -const path = require('path'); - -module.exports = { - resolve: { - alias: { - '@': path.resolve('resources/js'), - }, - }, -}; diff --git a/stubs/inertia-common/webpack.mix.js b/stubs/inertia-common/webpack.mix.js index 11700207f..a1c27a5ee 100644 --- a/stubs/inertia-common/webpack.mix.js +++ b/stubs/inertia-common/webpack.mix.js @@ -18,7 +18,9 @@ mix.js('resources/js/app.js', 'public/js') require('tailwindcss'), require('autoprefixer'), ]) - .webpackConfig(require('./webpack.config')); + .alias({ + '@': 'resources/js', + }); if (mix.inProduction()) { mix.version();