1.3.2 • Published 10 months ago

vite-plugin-watch-i18 v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Install

npm install vite-plugin-watch-i18

Usage

import viteWatchI18Plugin from 'vite-plugin-watch-i18';

export default defineConfig({
  plugins: [react(), viteWatchI18Plugin()]
}

Prettier Config

The prettier configuration when the plugin saves the file:

module.exports = {
  tabWidth: 2,
  semi: true,
  printWidth: 80,
  trailingComma: 'es5',
  arrowParens: 'always',
  proseWrap: 'preserve',
  useTabs: false,
  singleQuote: true,
  bracketSpacing: true,
  jsxBracketSameLine: false,
};

Project synchronization Prettier Config:

Create prettier.config.js

const viteWatchI18nPrettierConfig = require('vite-plugin-watch-i18/dist/prettier.config');
module.exports = {
  plugins: [],
  ...viteWatchI18nPrettierConfig,
};

Options

namedefaultValuetypedescription
funNametstringfunction call name
splitCode#stringsplit code
languageDir'locale/zh-CN', 'locale/en-US'string[]language package path
include'src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts'string[]include directory

Warn

Currently only supports locale file format:

export default {
  index: {
    confirm: '确认',
  },
};

Not supports:

const Locale = {
  index: {
    confirm: '确认',
  },
};
export default Locale;

The default export file of the language pack is index.ts or index.js

Example

Add

example

Modify

example

New Locale

example

Param

example

1.3.2

10 months ago

1.3.1

10 months ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

1.2.9

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago