@meteor-vite/plugin-zodern-relay
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Package Sidebar

Install

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

Weekly Downloads

18

Version

1.1.0

License

MIT

Unpacked Size

41 kB

Total Files

11

Last publish

Collaborators

  • jorgenvatle