You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: compile error following upgrade.md's vite to mix guide (#231)
* Update UPGRADE.md
Include fix for postcss.config.js when compiling assets
* Change code block to diff
* Add note to remove type from package.json
* Formatting changes to step headings
* Update UPGRADE.md
---------
Co-authored-by: Jess Archer <[email protected]>
Copy file name to clipboardExpand all lines: UPGRADE.md
+59-1Lines changed: 59 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -271,7 +271,7 @@ Then you will need to specify the base URL for assets in your application's entr
271
271
272
272
### Optional: Configure Tailwind
273
273
274
-
If you are using Tailwind, perhaps with one of Laravel's starter kits, you will need migrate your `tailwind.config.js` to use [Vite compatible imports](#vite-compatible-imports) and exports.
274
+
If you are using Tailwind, perhaps with one of Laravel's starter kits, you will need to migrate your `tailwind.config.js`configuration file to use [Vite compatible imports](#vite-compatible-imports) and exports:
@@ -459,6 +459,12 @@ Update your NPM scripts in `package.json`:
459
459
}
460
460
```
461
461
462
+
You should also remove the `type` key by running the following command:
463
+
464
+
```shell
465
+
npm pkg delete type
466
+
```
467
+
462
468
#### Inertia
463
469
464
470
Vite requires a helper function to import page components which is not required with Laravel Mix. You can remove this as follows:
@@ -538,3 +544,55 @@ You may also wish to remove any `.gitignore` paths you are no longer using:
538
544
- /bootstrap/ssr
539
545
- /public/build
540
546
```
547
+
548
+
### Optional: Configure Tailwind
549
+
550
+
If you are using Tailwind, perhaps with one of Laravel's starter kits, you will need to update your `tailwind.config.js` configuration file to use CommonJS imports and exports:
551
+
552
+
```diff
553
+
- import defaultTheme from 'tailwindcss/defaultTheme';
You may also migrate any PostCSS plugins from your `postcss.config.js` file to your `webpack.mix.js` file:
580
+
581
+
```diff
582
+
mix.js('resources/js/app.js', 'public/js')
583
+
.postCss('resources/css/app.css', 'public/css', [
584
+
- //
585
+
+ require("tailwindcss"),
586
+
]);
587
+
```
588
+
589
+
> **Note**
590
+
> You do not need to include the `autoprefixer` plugin as Laravel Mix includes this by default.
591
+
592
+
If you are using other PostCSS plugins, such as `postcss-import`, you will need to include them in your configuration. See the [Laravel Mix PostCSS documentation](https://laravel-mix.com/docs/6.0/postcss) for more information.
593
+
594
+
Finally, you may also remove your PostCSS config file:
0 commit comments