1.3.2 • Published 1 year ago

vite-plugin-watch-i18 v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

1.3.1

1 year 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

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago