diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..e1e292c --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,49 @@ +module.exports = { + env: { + browser: true, + es2021: true, + }, + extends: [ + 'plugin:vue/essential', + 'airbnb-base', + ], + parserOptions: { + ecmaVersion: 12, + sourceType: 'module', + }, + plugins: [ + 'vue', + 'prettier', + ], + rules: { + 'import/no-unresolved': 'off', + 'max-len': [ + 'error', + { + code: 100, + ignorePattern: 'd="([\\s\\S]*?)"', + }, + ], + + 'vue/max-len': [ + 'error', + { + template: 100, + ignorePattern: 'd="([\\s\\S]*?)"', + }, + ], + + yoda: [2, 'always'], + }, + overrides: [ + { + files: [ + '**/*.spec.js', + '**/*.spec.jsx', + ], + env: { + jest: true, + }, + }, + ], +}; diff --git a/.husky/pre-commit b/.husky/pre-commit index 3280849..87bc57f 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,7 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +export PHP_CS_FIXER_IGNORE_ENV=1 + npx lint-staged git add -A . diff --git a/.husky/pre-push b/.husky/pre-push index c8440c5..78b1c6d 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,5 +1,5 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -./vendor/bin/phpunit --coverage-html ./build +XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html ./build php coverage-checker.php ./build/clover.xml 95 diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b2095be --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "semi": false, + "singleQuote": true +} diff --git a/composer.json b/composer.json index 96cdee6..74bdfcf 100644 --- a/composer.json +++ b/composer.json @@ -21,12 +21,13 @@ "gaming-engine/dictionary": "1.*", "gaming-engine/string-tools": "1.*", "illuminate/contracts": "^8.37", + "laravel/fortify": "^1.8", "spatie/data-transfer-object": "^3.7", "spatie/laravel-package-tools": "^1.4.3" }, "require-dev": { "brianium/paratest": "^6.2", - "friendsofphp/php-cs-fixer": "^3.0", + "friendsofphp/php-cs-fixer": "3.*", "nunomaduro/collision": "^5.3", "orchestra/testbench": "^6.15", "phpunit/phpunit": "^9.3", @@ -67,7 +68,8 @@ "GamingEngine\\Core\\Framework\\Providers\\EventServiceProvider", "GamingEngine\\Core\\Framework\\Providers\\RouteServiceProvider", "GamingEngine\\Core\\Configuration\\Providers\\ConfigurationServiceProvider", - "GamingEngine\\Core\\Account\\Providers\\UserServiceProvider" + "GamingEngine\\Core\\Account\\Providers\\UserServiceProvider", + "GamingEngine\\Core\\Account\\Providers\\RouteServiceProvider" ], "aliases": { "Core": "GamingEngine\\Core\\CoreFacade" diff --git a/core.babel b/core.babel index deef6ae..8341d4c 100644 --- a/core.babel +++ b/core.babel @@ -1,5 +1,5 @@ - + + + + + + + + + + diff --git a/resources/views/framework/components/layouts/social-networks.blade.php b/resources/views/framework/components/layouts/social-networks.blade.php new file mode 100644 index 0000000..e74b5f3 --- /dev/null +++ b/resources/views/framework/components/layouts/social-networks.blade.php @@ -0,0 +1,37 @@ + diff --git a/resources/views/framework/components/layouts/splash.blade.php b/resources/views/framework/components/layouts/splash.blade.php new file mode 100644 index 0000000..1d84106 --- /dev/null +++ b/resources/views/framework/components/layouts/splash.blade.php @@ -0,0 +1,168 @@ + + + + + + + {{ $siteConfiguration->name }} + + + + + + + + + + + + +
+ + +
+
+ {{ $slot }} +
+
+
+
+ +
+

+ © {{ date('Y') }} {{ $siteConfiguration->name }}. All rights + reserved.

+
+
+
+
+
+ + diff --git a/resources/views/framework/components/logo.blade.php b/resources/views/framework/components/logo.blade.php index c84706e..11ea977 100644 --- a/resources/views/framework/components/logo.blade.php +++ b/resources/views/framework/components/logo.blade.php @@ -1,5 +1,7 @@ merge(['class' => "w-auto h-14"]) }} + @endif src="{{ $siteConfiguration->logoUrl }}" title="{{ $siteConfiguration->name }}" alt="{{ $siteConfiguration->name }}" diff --git a/resources/views/framework/components/notifications.blade.php b/resources/views/framework/components/notifications.blade.php new file mode 100644 index 0000000..9d177ff --- /dev/null +++ b/resources/views/framework/components/notifications.blade.php @@ -0,0 +1,15 @@ +@if (session('status')) +
+ {{ session('status') }} +
+@endif + +@if ($errors->any()) + +
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+@endif diff --git a/resources/views/framework/home.blade.php b/resources/views/framework/home.blade.php index 3807858..747e62f 100644 --- a/resources/views/framework/home.blade.php +++ b/resources/views/framework/home.blade.php @@ -1,3 +1,5 @@ - - - + +
+ Hello +
+
diff --git a/src/Account/Actions/CreateNewUser.php b/src/Account/Actions/CreateNewUser.php new file mode 100644 index 0000000..0c78089 --- /dev/null +++ b/src/Account/Actions/CreateNewUser.php @@ -0,0 +1,28 @@ +userRepository->create( + new UserDTO( + name: $input['name'], + email: $input['email'], + password: $input['password'], + ) + ); + } +} diff --git a/src/Account/DataTransfer/UserDTO.php b/src/Account/DataTransfer/UserDTO.php index 33926dc..d808da8 100644 --- a/src/Account/DataTransfer/UserDTO.php +++ b/src/Account/DataTransfer/UserDTO.php @@ -6,11 +6,11 @@ class UserDTO extends DataTransferObject { - public ?int $id; - - public string $name; - - public string $email; - - public string $password; + public function __construct( + public string $name, + public string $email, + public string $password, + public ?int $id = null + ) { + } } diff --git a/src/Account/Http/View/Components/AuthLayoutComponent.php b/src/Account/Http/View/Components/AuthLayoutComponent.php new file mode 100644 index 0000000..3c8d710 --- /dev/null +++ b/src/Account/Http/View/Components/AuthLayoutComponent.php @@ -0,0 +1,29 @@ +siteConfiguration = $siteConfiguration; + } + + public function render() + { + return view( + 'gaming-engine:core::account.components.auth.layout', + [ + 'siteConfiguration' => $this->siteConfiguration, + ] + ); + } +} diff --git a/src/Account/Http/View/Components/LoginComponent.php b/src/Account/Http/View/Components/LoginComponent.php new file mode 100644 index 0000000..5ed57e9 --- /dev/null +++ b/src/Account/Http/View/Components/LoginComponent.php @@ -0,0 +1,29 @@ +siteConfiguration = $siteConfiguration; + } + + public function render() + { + return view( + 'gaming-engine:core::account.components.auth.login', + [ + 'siteConfiguration' => $this->siteConfiguration, + ] + ); + } +} diff --git a/src/Account/Http/View/Components/RegisterComponent.php b/src/Account/Http/View/Components/RegisterComponent.php new file mode 100644 index 0000000..e45fefc --- /dev/null +++ b/src/Account/Http/View/Components/RegisterComponent.php @@ -0,0 +1,29 @@ +siteConfiguration = $siteConfiguration; + } + + public function render() + { + return view( + 'gaming-engine:core::account.components.auth.register', + [ + 'siteConfiguration' => $this->siteConfiguration, + ] + ); + } +} diff --git a/src/Account/Models/Authentication.php b/src/Account/Models/Authentication.php new file mode 100644 index 0000000..21e2d39 --- /dev/null +++ b/src/Account/Models/Authentication.php @@ -0,0 +1,10 @@ +routes(function () { + Route::prefix('api/v1/') + ->name('api.v1.') + ->group(__DIR__ . '/../Routes/api.php'); + + Route::middleware(['web', InstallationStatusMiddleware::class]) + ->group(__DIR__ . '/../Routes/web.php'); + }); + } +} diff --git a/src/Account/Providers/UserServiceProvider.php b/src/Account/Providers/UserServiceProvider.php index a28a395..6ff2e37 100644 --- a/src/Account/Providers/UserServiceProvider.php +++ b/src/Account/Providers/UserServiceProvider.php @@ -2,14 +2,28 @@ namespace GamingEngine\Core\Account\Providers; +use GamingEngine\Core\Account\Actions\CreateNewUser; +use GamingEngine\Core\Account\Http\View\Components\AuthLayoutComponent; use GamingEngine\Core\Account\Repositories\EloquentUserRepository; use GamingEngine\Core\Account\Repositories\UserRepository; +use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; +use Laravel\Fortify\Fortify; class UserServiceProvider extends ServiceProvider { public function register() { - $this->app->singleton(UserRepository::class, EloquentUserRepository::class); + $this->app->singleton( + UserRepository::class, + EloquentUserRepository::class + ); + + Blade::component(AuthLayoutComponent::class, 'layout', 'ge:c:a'); + + Fortify::loginView('gaming-engine:core::account.login'); + Fortify::registerView('gaming-engine:core::account.register'); + Fortify::requestPasswordResetLinkView('gaming-engine:core::account.forgot-password'); + Fortify::createUsersUsing(CreateNewUser::class); } } diff --git a/src/Account/Routes/api.php b/src/Account/Routes/api.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/src/Account/Routes/api.php @@ -0,0 +1 @@ +installed()) { + return; + } + View::composer('*', ConfigurationViewComposer::class); } } diff --git a/src/Configuration/Repositories/CachedConfigurationRepository.php b/src/Configuration/Repositories/CachedConfigurationRepository.php index 73f6c1d..181bf44 100644 --- a/src/Configuration/Repositories/CachedConfigurationRepository.php +++ b/src/Configuration/Repositories/CachedConfigurationRepository.php @@ -26,14 +26,6 @@ public function account(): AccountConfiguration ); } - public function site(): SiteConfiguration - { - return $this->cache( - SiteConfiguration::type(), - fn () => $this->configurationRepository->site() - ); - } - private function cache(string $category, callable $values) { return Cache::rememberForever( @@ -52,13 +44,21 @@ private function cacheKey(string $category): string ); } + public function site(): SiteConfiguration + { + return $this->cache( + SiteConfiguration::type(), + fn () => $this->configurationRepository->site() + ); + } + public function update(BaseConfiguration $configuration): BaseConfiguration { $response = $this->configurationRepository->update($configuration); Cache::put( $this->cacheKey($configuration::type()), - fn () => $response, + $response, ); return $response; diff --git a/src/CoreServiceProvider.php b/src/CoreServiceProvider.php index 780c913..3a468a1 100644 --- a/src/CoreServiceProvider.php +++ b/src/CoreServiceProvider.php @@ -8,8 +8,15 @@ use GamingEngine\Core\Framework\Database\ValidatesSchema; use GamingEngine\Core\Framework\Environment\Environment; use GamingEngine\Core\Framework\Environment\EnvironmentFactory; -use GamingEngine\Core\Framework\Http\View\Components\LayoutComponent; +use GamingEngine\Core\Framework\Http\View\Components\Alerts\AlertComponent; +use GamingEngine\Core\Framework\Http\View\Components\Alerts\ErrorAlertComponent; +use GamingEngine\Core\Framework\Http\View\Components\Alerts\InformationAlertComponent; +use GamingEngine\Core\Framework\Http\View\Components\Alerts\SuccessAlertComponent; +use GamingEngine\Core\Framework\Http\View\Components\Layouts\LayoutComponent; +use GamingEngine\Core\Framework\Http\View\Components\Layouts\SocialNetworksComponent; +use GamingEngine\Core\Framework\Http\View\Components\Layouts\SplashLayoutComponent; use GamingEngine\Core\Framework\Http\View\Components\LogoComponent; +use GamingEngine\Core\Framework\Http\View\Components\NotificationComponent; use GamingEngine\Core\Framework\Module\CachedModuleCollection; use GamingEngine\Core\Framework\Module\CoreModule; use GamingEngine\Core\Framework\Module\CoreModuleCollection; @@ -27,8 +34,18 @@ public function configurePackage(Package $package): void ->hasConfigFile('gaming-engine-core') ->hasViews(); - Blade::component('ge:c-layout', LayoutComponent::class); - Blade::component('ge:c-logo', LogoComponent::class); + Blade::component(LayoutComponent::class, 'layout', 'ge:c'); + Blade::component(SplashLayoutComponent::class, 'layout', 'ge:c'); + Blade::component(LogoComponent::class, 'logo', 'ge:c'); + Blade::component(NotificationComponent::class, 'notifications', 'ge:c'); + Blade::component(SocialNetworksComponent::class, 'social-networks', 'ge:c'); + + + Blade::component(AlertComponent::class, 'alert', 'ge:c'); + Blade::component(ErrorAlertComponent::class, 'error-alert', 'ge:c'); + Blade::component(SuccessAlertComponent::class, 'success-alert', 'ge:c'); + Blade::component(InformationAlertComponent::class, 'information-alert', 'ge:c'); + $this->loadMigrationsFrom([ 'database/migrations', @@ -40,6 +57,39 @@ public function configurePackage(Package $package): void $this->publishLanguages(); } + private function publishAssets(): void + { + $environment = $this->environment(); + + $this->publishes([ + __DIR__ . "/../dist/$environment/" => 'public/modules/framework/', + __DIR__ . '/../resources/images' => 'public/images/framework/', + ], 'gaming-engine:core-resources'); + } + + private function environment(): string + { + /** + * @var Environment + */ + return $this->app->get(Environment::class) + ->name(); + } + + private function publishMigrations() + { + $this->publishes([ + __DIR__ . '/../database/migrations/' => database_path('migrations'), + ], 'gaming-engine:core-migrations'); + } + + private function publishSeeders() + { + $this->publishes([ + __DIR__ . '/../database/seeders/CoreDatabaseSeeder.stub' => database_path('seeders/CoreDatabaseSeeder.php'), + ], 'gaming-engine:core-seeders'); + } + public function publishLanguages() { $this->loadTranslationsFrom( @@ -89,38 +139,4 @@ public function packageBooted() $core->registerPackage(app(CoreModule::class)); } - - private function publishAssets(): void - { - $environment = $this->environment(); - - $this->publishes([ - __DIR__ . "/../dist/$environment/public/js/" => 'public/js/framework/', - __DIR__ . "/../dist/$environment/public/css/" => 'public/css/framework/', - __DIR__ . '/../resources/images' => 'public/images/framework/', - ], 'gaming-engine:core-resources'); - } - - private function environment(): string - { - /** - * @var Environment - */ - return $this->app->get(Environment::class) - ->name(); - } - - private function publishMigrations() - { - $this->publishes([ - __DIR__ . '/../database/migrations/' => database_path('migrations'), - ], 'gaming-engine:core-migrations'); - } - - private function publishSeeders() - { - $this->publishes([ - __DIR__ . '/../database/seeders/CoreDatabaseSeeder.stub' => database_path('seeders/CoreDatabaseSeeder.php'), - ], 'gaming-engine:core-seeders'); - } } diff --git a/src/Framework/Http/View/Components/Alerts/AlertComponent.php b/src/Framework/Http/View/Components/Alerts/AlertComponent.php new file mode 100644 index 0000000..861cf1c --- /dev/null +++ b/src/Framework/Http/View/Components/Alerts/AlertComponent.php @@ -0,0 +1,14 @@ + $this->siteConfiguration, ] diff --git a/src/Framework/Http/View/Components/Layouts/SocialNetworksComponent.php b/src/Framework/Http/View/Components/Layouts/SocialNetworksComponent.php new file mode 100644 index 0000000..3797bc6 --- /dev/null +++ b/src/Framework/Http/View/Components/Layouts/SocialNetworksComponent.php @@ -0,0 +1,29 @@ +siteConfiguration = $siteConfiguration; + } + + public function render() + { + return view( + 'gaming-engine:core::framework.components.layouts.social-networks', + [ + 'siteConfiguration' => $this->siteConfiguration, + ] + ); + } +} diff --git a/src/Framework/Http/View/Components/Layouts/SplashLayoutComponent.php b/src/Framework/Http/View/Components/Layouts/SplashLayoutComponent.php new file mode 100644 index 0000000..07a323a --- /dev/null +++ b/src/Framework/Http/View/Components/Layouts/SplashLayoutComponent.php @@ -0,0 +1,29 @@ +siteConfiguration = $siteConfiguration; + } + + public function render() + { + return view( + 'gaming-engine:core::framework.components.layouts.splash', + [ + 'siteConfiguration' => $this->siteConfiguration, + ] + ); + } +} diff --git a/src/Framework/Http/View/Components/NotificationComponent.php b/src/Framework/Http/View/Components/NotificationComponent.php new file mode 100644 index 0000000..ec03c66 --- /dev/null +++ b/src/Framework/Http/View/Components/NotificationComponent.php @@ -0,0 +1,13 @@ +group(function () { - Route::get('/', HomeController::class) - ->name('home'); - }); + $this->routes(function () { + Route::prefix('api/v1/') + ->name('api.v1.') + ->group(__DIR__ . '/../Routes/api.php'); - Route::get('/installation', InstallationRequiredController::class) - ->name('installation-required'); + Route::middleware('web') + ->middleware(InstallationStatusMiddleware::class) + ->group(__DIR__ . '/../Routes/web.php'); + + Route::get('/installation', InstallationRequiredController::class) + ->name('installation-required'); + }); } } diff --git a/src/Framework/Routes/api.php b/src/Framework/Routes/api.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/src/Framework/Routes/api.php @@ -0,0 +1 @@ +name('home'); diff --git a/tailwind.config.js b/tailwind.config.js index 88c1ffb..fa433d1 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,19 +1,21 @@ module.exports = { - purge: [ + purge: [ './resources/**/*.blade.php', './resources/**/*.js', './resources/**/*.vue', ], - darkMode: false, // or 'media' or 'class' + darkMode: 'media', // or 'media' or 'class' theme: { extend: {}, }, variants: { - extend: {}, + extend: { + opacity: ['disabled'], + }, }, plugins: [ - require('@tailwindcss/forms'), - require('@tailwindcss/typography'), - require('@tailwindcss/aspect-ratio'), + require('@tailwindcss/forms'), + require('@tailwindcss/typography'), + require('@tailwindcss/aspect-ratio'), ], -} +}; diff --git a/tests/Account/Repositories/EloquentUserRepositoryTest.php b/tests/Account/Repositories/EloquentUserRepositoryTest.php index 3a72c71..f599d51 100644 --- a/tests/Account/Repositories/EloquentUserRepositoryTest.php +++ b/tests/Account/Repositories/EloquentUserRepositoryTest.php @@ -56,11 +56,11 @@ public function eloquent_user_repository_returns_null_if_it_cannot_find_a_user() public function eloquent_user_repository_creates_a_user() { // Arrange - $details = new UserDTO([ - 'name' => $this->faker->name, - 'email' => $this->faker->email, - 'password' => $this->faker->password, - ]); + $details = new UserDTO( + name: $this->faker->name, + email: $email = $this->faker->email, + password: $this->faker->password, + ); $repository = app(EloquentUserRepository::class); // Act @@ -79,11 +79,11 @@ public function eloquent_user_repository_creates_a_user() public function eloquent_user_repository_throws_an_exception_if_a_duplicate_user_is_provided() { // Arrange - $details = new UserDTO([ - 'name' => $this->faker->name, - 'email' => $email = $this->faker->email, - 'password' => $this->faker->password, - ]); + $details = new UserDTO( + name: $this->faker->name, + email: $email = $this->faker->email, + password: $this->faker->password, + ); $repository = app(EloquentUserRepository::class); User::factory()->create([ @@ -105,11 +105,11 @@ public function eloquent_user_repository_fires_an_event_when_the_user_is_created { // Arrange Event::fake(); - $details = new UserDTO([ - 'name' => $this->faker->name, - 'email' => $this->faker->email, - 'password' => $this->faker->password, - ]); + $details = new UserDTO( + name: $this->faker->name, + email: $email = $this->faker->email, + password: $this->faker->password, + ); $repository = app(EloquentUserRepository::class); // Act diff --git a/tests/Configuration/Repositories/CachedConfigurationRepositoryTest.php b/tests/Configuration/Repositories/CachedConfigurationRepositoryTest.php index b52fa3e..42f7f1c 100644 --- a/tests/Configuration/Repositories/CachedConfigurationRepositoryTest.php +++ b/tests/Configuration/Repositories/CachedConfigurationRepositoryTest.php @@ -127,7 +127,7 @@ public function cached_configuration_will_re_cache_the_data_on_update() $repository = new CachedConfigurationRepository($wrapped); Cache::shouldReceive('put') - ->withArgs(fn ($key, $c) => $configuration === $c()) + ->withArgs(fn ($key, $c) => $configuration === $c) ->andReturn($configuration); $wrapped->shouldReceive('update') diff --git a/tests/Framework/Http/Controllers/HomeControllerTest.php b/tests/Framework/Http/Controllers/HomeControllerTest.php index aaf910c..c560dbb 100644 --- a/tests/Framework/Http/Controllers/HomeControllerTest.php +++ b/tests/Framework/Http/Controllers/HomeControllerTest.php @@ -13,6 +13,8 @@ class HomeControllerTest extends TestCase public function home_controller_you_are_able_to_see_the_homepage() { // Arrange + $this->withoutMix(); + $installationStatus = $this->mock(Core::class); $installationStatus->shouldReceive('installed') ->andReturnTrue(); diff --git a/tests/TestCase.php b/tests/TestCase.php index 9544cbd..0c170ad 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,15 +2,17 @@ namespace GamingEngine\Core\Tests; +use GamingEngine\Core\Account\Providers\RouteServiceProvider as AccountRouteServiceProvider; use GamingEngine\Core\Account\Providers\UserServiceProvider; use GamingEngine\Core\Configuration\Providers\ConfigurationServiceProvider; use GamingEngine\Core\CoreServiceProvider; use GamingEngine\Core\Database\Seeders\AccountConfigurationKeySeeder; use GamingEngine\Core\Database\Seeders\SiteConfigurationKeySeeder; use GamingEngine\Core\Framework\Providers\EventServiceProvider; -use GamingEngine\Core\Framework\Providers\RouteServiceProvider; +use GamingEngine\Core\Framework\Providers\RouteServiceProvider as CoreRouteServiceProvider; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; +use Laravel\Fortify\FortifyServiceProvider; use Orchestra\Testbench\TestCase as Orchestra; class TestCase extends Orchestra @@ -52,9 +54,11 @@ protected function getPackageProviders($app) return [ CoreServiceProvider::class, EventServiceProvider::class, - RouteServiceProvider::class, + CoreRouteServiceProvider::class, ConfigurationServiceProvider::class, UserServiceProvider::class, + AccountRouteServiceProvider::class, + FortifyServiceProvider::class, ]; } } diff --git a/webpack.mix.js b/webpack.mix.js index 453861a..d7a7958 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -1,5 +1,4 @@ const mix = require('laravel-mix'); -const webpack = require('webpack'); const path = require('path'); /* @@ -16,27 +15,31 @@ const path = require('path'); const environment = mix.inProduction() ? 'prod' : 'local'; mix.options({ - terser: { - terserOptions: { - compress: { - drop_console: true, - }, - }, - }, - }) - .setPublicPath(`dist/${environment}`) - .js('resources/js/app.js', 'public/js') - .vue() - .postCss('resources/css/app.css', 'public/css/gaming-engine.css', [ - require('tailwindcss'), - ]) - .version() - .webpackConfig({ - resolve: { - symlinks: false, - alias: { - '@': path.resolve(__dirname, 'resources/js/'), - }, - }, - plugins: [new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)], - }); + terser: { + terserOptions: { + compress: { + drop_console: true, + }, + }, + }, +}) + .extract() + .setPublicPath(`dist/${environment}`) + .js('resources/js/app.js', 'public/js') + .vue({ + version: 3, + }) + .postCss('resources/css/app.css', 'public/css/gaming-engine.css', [ + require('tailwindcss'), + ]) + .extract() + .version() + .webpackConfig({ + resolve: { + symlinks: false, + alias: { + '@mixins': path.resolve(__dirname, 'resources/js/mixins'), + '@components': path.resolve(__dirname, 'resources/js/components'), + }, + }, + });