Created
December 21, 2021 14:53
-
-
Save zealot128/aadb277e80893601f7ddb63ef2cf2023 to your computer and use it in GitHub Desktop.
Vite-rails + Inertia base setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createApp, h } from 'vue' | |
import { createInertiaApp } from '@inertiajs/inertia-vue3' | |
import i18n from '~/utils/i18n' | |
createInertiaApp({ | |
resolve: name => import(`/pages/${name}.vue`), | |
setup({ el, app, props, plugin }) { | |
createApp({ render: () => h(app, props) }) | |
.use(plugin) | |
.use(i18n) | |
.mount(el) | |
}, | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig } from 'vite' | |
import RubyPlugin from 'vite-plugin-ruby' ? import FullReload from "vite-plugin-full-reload" | |
import vue from '@vitejs/plugin-vue' | |
import vueJsx from '@vitejs/plugin-vue-jsx' | |
export default defineConfig({ | |
server: { hmr: { | |
host: process.env.VITE_WSS_HOST, | |
port: 443, protocol: 'wss', | |
}, | |
}, | |
plugins: [ | |
RubyPlugin(), | |
vue({ ssr: false, isProduction: false}), | |
vueJsx({}), | |
FullReload(["config/routes.rb", "app/views/**/*", "app/controllers/**/*"], { delay: 200, | |
}), | |
], | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"all": { | |
"sourceCodeDir": "app/javascript", | |
"watchAdditionalPaths": [] | |
}, | |
"development": { | |
"autoBuild": true, | |
"publicOutputDir": "vite-dev", | |
"port": 3036 | |
}, | |
"test": { | |
"autoBuild": true, | |
"publicOutputDir": "vite-test", | |
"port": 3037 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment