Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Latest commit

 

History

History
59 lines (44 loc) · 2 KB

File metadata and controls

59 lines (44 loc) · 2 KB

🐝 vite-plugin-splitbee

A small plugin to add Splitbee support to Vite

License Vite Version Downloads

🦄 Usage

Install the dependency

npm install --save-dev vite-plugin-splitbee # yarn add -D vite-plugin-splitbee

Add it to your Vite config

// vite.config.ts
import Splitbee from 'vite-plugin-splitbee';

export default {
    plugins: [
        Splitbee(),
    ]
}

🔧 Configuration

export default {
    plugins: [
        Splitbee({
            /// Provide a custom API url to use instead of the default Splitbee one (Optional) [Default: 'https://hive.splitbee.io']
            api_url: string,

            /// When using A/B testing, you can prevent the initial content flash by making the script blocking/synchronous (Optional) [Default: false]
            async: boolean,

            /// Whether to include Splitbee analytics during local development (Optional) [Default: false]
            dev: boolean,

            /// Whether to enable cookie-less mode (Optional) [Default: false]
            disable_cookie: boolean,

            /// To use Splitbee on another subdomain you can provide a project token. This can be found in project settings (Optional)
            token: string,

            /// URL to Splitbee script to load (Optional) [Default: 'https://cdn.splitbee.io/sb.js']
            url: string,
        }),
    ],
}

⚠️ Requirements

Currently this plugin only supports Vite 2.x