Skip to content

Commit

Permalink
Add vite 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ycs77 committed Jul 16, 2022
1 parent 6b0d9c1 commit 8a82c34
Show file tree
Hide file tree
Showing 18 changed files with 764 additions and 725 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -17,5 +17,6 @@ module.exports = {
],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/prefer-ts-expect-error': 'off',
},
}
20 changes: 11 additions & 9 deletions README.md
Expand Up @@ -376,24 +376,26 @@ Inertia::render('MyRuntimePluin::Some');

```js
Inertia({
// Current work directory
// Current work directory.
cwd: process.cwd(),

// Define namespace mapping
// Define namespace mapping.
namespaces: [],

// Namespace separator
// Namespace separator.
separator: '::',

// Module extension
// (Defaults to '.vue' if not set and used with vite)
extension: '',
// Module extensions.
extensions: '',
// extensions: 'vue', // if use vite the defaults is 'vue'
// extensions: 'vue', // webpack example
// extensions: ['vue', 'js'], // vite example

// Use `import()` to load pages for webpack, default is using `require()`
// Only for webpack
// Use `import()` to load pages for webpack, default is using `require()`.
// Only for webpack.
import: false,

// Enable SSR mode
// Enable SSR mode.
ssr: false,
})
```
Expand Down
10 changes: 6 additions & 4 deletions package.json
Expand Up @@ -71,23 +71,25 @@
"test": "vitest"
},
"dependencies": {
"unplugin": "^0.7.0"
"debug": "^4.3.4",
"fast-glob": "^3.2.11",
"unplugin": "^0.7.1"
},
"devDependencies": {
"@swc/core": "^1.2.208",
"@types/debug": "^4.1.7",
"@types/node": "^17.0.45",
"@ycs77/eslint-config": "^0.1.2",
"bumpp": "^7.2.0",
"eslint": "^8.17.0",
"esno": "^0.16.3",
"fast-glob": "^3.2.11",
"jsonc-eslint-parser": "^2.1.0",
"npm-run-all": "^4.1.5",
"rollup": "^2.75.6",
"tsup": "^6.1.2",
"typescript": "~4.7.3",
"vite": "^2.9.12",
"vitest": "^0.12.10",
"vite": "^2.9.14",
"vitest": "^0.18.0",
"webpack": "^5.73.0"
}
}
1 change: 1 addition & 0 deletions playground/app.ts
Expand Up @@ -13,6 +13,7 @@ createApp({
// component: 'Page2',
// component: 'my-package-1::Page3',
// component: 'my-package-2::Page222',
// component: 'my-package-2::Page223',
// component: 'my-php-package::PhpPackagePage',
props: {},
url: '/',
Expand Down
3 changes: 0 additions & 3 deletions playground/composer.json

This file was deleted.

14 changes: 8 additions & 6 deletions playground/package.json
@@ -1,19 +1,21 @@
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"serve": "vite preview"
"dev": "cross-env DEBUG=inertia-plugin:* vite",
"build": "cross-env DEBUG=inertia-plugin:* vue-tsc --noEmit && vite build",
"serve": "cross-env DEBUG=inertia-plugin:* vite preview"
},
"dependencies": {
"@inertiajs/inertia": "^0.11.0",
"@inertiajs/inertia-vue3": "^0.6.0",
"vue": "^3.2.37"
},
"devDependencies": {
"@vitejs/plugin-vue": "^2.3.2",
"typescript": "^4.6.4",
"vite": "^2.9.9",
"@vitejs/plugin-vue": "^2.3.3",
"cross-env": "^7.0.3",
"inertia-plugin": "workspace:*",
"typescript": "~4.7.3",
"vite": "^2.9.14",
"vite-plugin-inspect": "^0.5.0",
"vue-tsc": "^0.34.11"
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion playground/vite.config.ts
@@ -1,7 +1,7 @@
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import Inspect from 'vite-plugin-inspect'
import Inertia from '../src/vite'
import Inertia from 'inertia-plugin/vite'

export default defineConfig({
plugins: [
Expand Down

0 comments on commit 8a82c34

Please sign in to comment.