/go-vite-plugin

Go plugin for Vite

Primary LanguageHTMLMIT LicenseMIT

Go Vite Plugin

Introduction

Vite is a modern frontend build tool that provides an extremely fast development environment and bundles your code for production.

This plugin configures Vite for use with a Go backend server.

Usage

install:

npm i go-vite-plugin

config in the vite.config.js:

import { defineConfig } from 'vite';
import go from 'go-vite-plugin';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    plugins: [
        go({
            input: 'resources/js/app.js',  // js source code entry point
            refresh: true,
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
    ]
});

when you run npm run dev, then you can visit http://localhost:5173 in your browser:

go-vite-plugin

License

The Go Vite plugin is open-sourced software licensed under the MIT license.