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

0.11.0 • Public • Published

@traduki/vite-plugin-traduki

npm

See main github repository readme.md

Examples

Install

npm install --save-dev @traduki/vite-plugin-traduki
npm install @traduki/runtime # or @traduki/react if you're using React

Usage

Create a vite.config.ts configuration file and import the plugin:

// vite.config.ts
import type { UserConfig } from 'vite';
import tradukiPlugin from '@traduki/vite-plugin-traduki';

export default: UserConfig = {
    jsx: 'react', // In case you're using React
    plugins: [tradukiPlugin({
        /*
         * Description: Hashing function for the global message keys
         * Default: ({ key, texts[] }) => string
         * Optional
         */
        keyHashFn: myCustomHashFunction, // Probably won't need this, the default should be just fine
        /*
         * Description: Match files to be handled by Traduki
         * Default: /\.messages\.yaml$/
         * Optional
         */
        includes: /\.messages\.yaml$/,
    })],
};

Package Sidebar

Install

npm i @traduki/vite-plugin-traduki

Weekly Downloads

24

Version

0.11.0

License

MIT

Unpacked Size

15.2 kB

Total Files

9

Last publish

Collaborators

  • havelaer