📚 Reference
📜 Chapter
unplugin
is an unified plugin system for bundle tool such as vite, webpack, rollup, esbuild and etc.@intlify/unplugin-vue-i18n
for vite and webpack.# NPM
npm install --save-dev @intlify/unplugin-vue-i18n
# YARN
yarn add -D @intlify/unplugin-vue-i18n
vite
예시 1
// vite.config.ts
import { defineConfig } from 'vite'
import { resolve, dirname } from 'node:path'
import { fileURLToPath } from 'url'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
export default defineConfig({
/* ... */
plugins: [
/* ... */
VueI18nPlugin({
/* options */
// locale messages resource pre-compile option
include: resolve(dirname(fileURLToPath(import.meta.url)), './path/to/src/locales/**'),
}),
],
})