Skip to content

Latest commit

 

History

History
 
 

plugin-zodern-relay

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Vite plugin zodern:relay

This is a Vite compatability package for zodern:relay - type safe Meteor methods and publications.

This plugin acts as partial replacement for the Babel @zodern/babel-plugin-meteor-relay plugin required by zodern:relay. You still need the Babel plugin as it might still be required on the server.

Installation

npm i -D @meteor-vite/plugin-zodern-relay

Configuration

Add the plugin to your Vite config and you're all set. If your methods and publications reside outside of imports/api/<methods|publications>, specify those paths when calling the plugin.

// vite.config.ts
import zodernRelay from '@meteor-vite/plugin-zodern-relay';
import { meteor } from 'meteor-vite/plugin';

export default defineConfig({
    plugins: [
        meteor({
            clientEntry: '...',
        }),
        zodernRelay({
            directories: {
                /**
                 * Path to directories where your zodern:relay methods live
                 * @default ['./imports/methods']
                 */
                methods: ['./imports/methods'],
                
                /**
                 * Path to the directories where your zodern:relay publications live.
                 * @default ['./imports/publications']
                 */
                publications: ['./imports/publications'],
            }
        }),
    ]
})

Usage & Documentation

You can use zodern:relay like you normally would. Consult their readme for documentation.

License

MIT