Skip to content

Commit

Permalink
vite 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona committed Feb 15, 2024
1 parent 2a9d83d commit c902795
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [18.x, 20.x, 21.x]

steps:
- name: Checkout code
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export default defineConfig({

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. [Follow Us](https://twitter.com/FabioIvona) on Twitter for more updates about this package.

## Upgrade

Please see [UPGRADE GUIDE](UPGRADE.md) for more information on upgrading between versions

## Contributing

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
Expand Down
31 changes: 31 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Upgrade Guide

## `1.x` to `2.x`

This release adds support for Vite 5 and removes support for Vite 3 and 4.

### Notable Changes

1. Dropped support for CJS

### Upgrade Path

1. Update to the latest version of the `laravel-vite-plugin`, `vite`, `vite-livewire-plugin`, and any Vite plugins you may have installed.

The following command will update `vite-livewire-plugin`, `laravel-vite-plugin` and `vite` only:

```
npm install vite@^5.0.0 laravel-vite-plugin@^1.x @defstudio/vite-livewire-plugin@^2.x
```

You should also check the upgrade guide and changelogs for any packages you update. The [`vite` migrations guide](https://vitejs.dev/guide/migration.html) is available on their website.

2. Ensure your `package.json` contains `"type": "module"`.

Run the following command in your project's root directory or anywhere you have your `package.json` files:

```sh
npm pkg set type=module
```

You may also need to rename any `*.js` configuration files that contain CJS, which is the older-style Node-flavored `var plugin = require('plugin')` syntax, to `filename.cjs` after making this change.
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "@defstudio/vite-livewire-plugin",
"version": "1.3.2",
"version": "2.0.0-alpha.1",
"author": {
"name": "Fabio Ivona"
},
"type": "module",
"description": "Livewire plugin for Vite",
"keywords": [
"laravel",
Expand All @@ -19,8 +20,7 @@
"license": "MIT",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"default": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
Expand All @@ -30,10 +30,9 @@
"scripts": {
"deploy": "npm run build && npm publish",
"build": "npm run build-plugin",
"build-plugin": "rm -rf dist && npm run build-plugin-types && npm run build-plugin-esm && npm run build-plugin-cjs",
"build-plugin": "rm -rf dist && npm run build-plugin-types && npm run build-plugin-esm",
"build-plugin-types": "tsc --emitDeclarationOnly",
"build-plugin-cjs": "esbuild src/index.ts --platform=node --format=cjs --outfile=dist/index.cjs",
"build-plugin-esm": "esbuild src/index.ts --platform=node --format=esm --outfile=dist/index.mjs",
"build-plugin-esm": "esbuild src/index.ts --platform=node --format=esm --outfile=dist/index.js",
"lint": "eslint --ext .ts ./src",
"test": "vitest run"
},
Expand All @@ -53,7 +52,7 @@
"vite": "^5.0.0"
},
"engines": {
"node": ">=18"
"node": "^18.0.0 || >=20.0.0"
},
"dependencies": {
"minimatch": "^9.0.3",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"compilerOptions": {
"outDir": "./dist",
"target": "ES2020",
"module": "ES2020",
"moduleResolution": "node",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"skipLibCheck": true,
"resolveJsonModule": true,
"strict": true,
Expand Down

0 comments on commit c902795

Please sign in to comment.