Skip to content

Commit 8745b0e

Browse files
authored
Merge pull request #12 from dcblogdev/feature/replace-webpack-with-vite
Feature/replace webpack with vite
2 parents 5a17e70 + 3ad8d12 commit 8745b0e

23 files changed

+54
-144
lines changed

.env

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,10 @@ composer update
4848

4949
>Ensure you've updated .env before migrating.
5050
51-
Migrate the database
51+
Migrate and seed the database
5252

5353
```
54-
php artisan migrate
55-
```
56-
57-
Seed the database
58-
59-
```
60-
php artisan db:seed
54+
php artisan db:build
6155
```
6256

6357
Link Storage to public

changelog.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/AdminTwServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AdminTwServiceProvider extends ServiceProvider
1212
*
1313
* @return void
1414
*/
15-
public function register()
15+
public function register(): void
1616
{
1717

1818
}
@@ -22,7 +22,7 @@ public function register()
2222
*
2323
* @return void
2424
*/
25-
public function boot()
25+
public function boot(): void
2626
{
2727
if (! $this->app->runningInConsole()) {
2828
return;
@@ -38,7 +38,7 @@ public function boot()
3838
*
3939
* @return array
4040
*/
41-
public function provides()
41+
public function provides(): array
4242
{
4343
return [Console\InstallCommand::class];
4444
}

src/Console/InstallCommand.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class InstallCommand extends Command
2626
*
2727
* @return void
2828
*/
29-
public function handle()
29+
public function handle(): void
3030
{
3131
//copy folders
3232
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app', base_path('app'));
@@ -37,18 +37,22 @@ public function handle()
3737
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/stubs', base_path('stubs'));
3838
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/tests', base_path('tests'));
3939

40-
// Tailwind / Webpack...
4140
copy(__DIR__.'/../../stubs/composer.json', base_path('composer.json'));
4241
copy(__DIR__.'/../../stubs/phpunit.xml', base_path('phpunit.xml'));
4342
copy(__DIR__.'/../../stubs/package.json', base_path('package.json'));
43+
copy(__DIR__.'/../../stubs/postcss.config.js', base_path('postcss.config.js'));
4444
copy(__DIR__.'/../../stubs/tailwind.config.js', base_path('tailwind.config.js'));
45-
copy(__DIR__.'/../../stubs/webpack.mix.js', base_path('webpack.mix.js'));
45+
copy(__DIR__.'/../../stubs/vite.config.js', base_path('vite.config.js'));
4646

4747
if (file_exists(base_path('resources/views/welcome.blade.php'))) {
4848
unlink(base_path('resources/views/welcome.blade.php'));
4949
}
5050

51+
if (file_exists(base_path('resources/css/app.css'))) {
52+
unlink(base_path('resources/css/app.css'));
53+
}
54+
5155
$this->info('Admin theme installed successfully.');
52-
$this->info('Please run "composer update" then "npm install && npm run dev" command to build your assets.');
56+
$this->info('Please run "composer update" then "npm install && npm run build" command to build your assets.');
5357
}
5458
}

stubs/package.json

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,23 @@
11
{
22
"private": true,
33
"scripts": {
4-
"dev": "npm run development",
5-
"development": "mix",
6-
"watch": "mix watch",
7-
"watch-poll": "mix watch -- --watch-options-poll=1000",
8-
"hot": "mix watch --hot",
9-
"prod": "npm run production",
10-
"production": "mix --production"
4+
"dev": "vite",
5+
"build": "vite build"
116
},
127
"devDependencies": {
13-
"@tailwindcss/forms": "^0.4.0",
14-
"@tailwindcss/typography": "^0.5.1",
15-
"alpinejs": "^3.4.2",
16-
"autoprefixer": "^10.1.0",
8+
"@fortawesome/fontawesome-free": "^6.2.1",
9+
"@tailwindcss/typography": "^0.5.8",
10+
"alpinejs": "^3.10.5",
11+
"autoprefixer": "^10.4.13",
1712
"axios": "^0.25",
18-
"laravel-mix": "^6.0.6",
13+
"filepond": "^4.30.4",
14+
"flatpickr": "^4.6.13",
15+
"laravel-vite-plugin": "^0.7.2",
1916
"lodash": "^4.17.19",
20-
"postcss": "^8.2.1",
21-
"postcss-import": "^14.0.1",
22-
"sass": "^1.49.7",
23-
"sass-loader": "^12.4.0",
24-
"tailwindcss": "^3.0.0",
25-
"filepond": "^4.25.1",
26-
"flatpickr": "^4.6.9",
27-
"prismjs": "^1.23.0",
28-
"@fortawesome/fontawesome-free": "^6.0.0"
17+
"postcss": "^8.4.20",
18+
"tailwindcss": "^3.2.4",
19+
"vite": "^4.0.0",
20+
"prismjs": "^1.29.0",
21+
"sass": "^1.57.1"
2922
}
3023
}

stubs/postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}
182 KB
Binary file not shown.
105 KB
Binary file not shown.

0 commit comments

Comments
 (0)