0.3.5 • Published 6 days ago

@univerjs/vite-plugin v0.3.5

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
6 days ago

@univerjs/vite-plugin

Installation

npm install @univerjs/vite-plugin

Usage

Add the plugin to your vite.config.ts:

import { defineConfig } from 'vite'
import { univerPlugin } from '@univerjs/vite-plugin'

export default defineConfig({
  plugins: [
    univerPlugin()
  ]
})

Features

Automatic Import of Required CSS

This feature is enabled by default. You can disable it by passing css: false to the plugin options.

export default defineConfig({
  plugins: [
    univerPlugin({
+      css: false
    })
  ]
})

Simplified Import of Language Packs

The plugin provides a virtual module univer:locales, which simplifies the import of language packs.

import { LocaleType } from '@univerjs/core'

import { enUS, ruRU, zhCN } from 'univer:locales'

new Univer({
  locales: {
    [LocaleType.ZH_CN]: zhCN,
    [LocaleType.EN_US]: enUS,
    [LocaleType.RU_RU]: ruRU
  }
})

TypeScript Support

In order for TypeScript to recognize the univer:locales import, you should add a reference to the src/vite-env.d.ts file in your project.

/// <reference types="vite/client" />
+ /// <reference types="@univerjs/vite-plugin/types" />

Options

  • css: boolean - Whether to automatically import required CSS. Default is true.
0.3.5

6 days ago

0.3.4

6 days ago

0.3.3

11 days ago

0.3.2

2 months ago

0.3.1

2 months ago

0.3.0

3 months ago

0.2.1

3 months ago

0.2.0

3 months ago

0.2.6

3 months ago

0.2.3

3 months ago

0.2.2

3 months ago

0.2.5

3 months ago

0.2.4

3 months ago

0.1.1

3 months ago

0.1.0

3 months ago