3.0.0
+https://unpkg.com/vue-i18n@next
unpkg.com provides a npm-based CDN links. The above link will always point to the latest release on npm.
You can also use a specific version/tag via URLs like https://unpkg.com/vue-i18n@9.0.0-rc.1/dist/vue-i18n.global.js
You can also use a specific version/tag via URLs like https://unpkg.com/vue-i18n@9.0.0-rc.1/dist/vue-i18n.esm-browser.js
When using with a module system, you must explicitly install the vue-i18n
via app.use()
:
You will have to clone directly from GitHub and build vue-i18n
yourself if you want to use the latest dev build.
In the dist/ directory of the npm package you will find many different builds of Vue I18n. Here is an overview of which dist file should be used depending on the use-case.
vue-i18n(.runtime).global(.prod).js
:
<script src="...">
in the browser. Exposes the VueI18n
globalvue-i18n.global.js
is the "full" build that includes both the compiler and the runtime so it supports compiling message formats on the flyvue-i18n.runtime.global.js
contains only the runtime and requires message formats to be pre-compiled during a build step*.prod.js
files for production:::tip NOTE
Global builds are not UMD builds. They are built as IIFEs and are only meant for direct use via <script src="...">
.
:::
vue-i18n(.runtime).esm-browser(.prod).js
:
<script type="module">
)vue-i18n(.runtime).esm-bundler.js
:
webpack
, rollup
and parcel
process.env.NODE_ENV
guards (must be replaced by bundler)@intlify/core-base
, @intlify/message-compiler
)
esm-bundler
builds and will in turn import their dependencies (e.g. @intlify/message-compiler
imports @intlify/shared
)vue-i18n.runtime.esm-bundler.js
is runtime only, and requires all locale messages to be pre-compiled. This is the default entry for bundlers (via module
field in package.json
) because when using a bundler templates are typically pre-compiled (e.g. in *.json
files)vue-i18n.esm-bundler.js
(default): includes the runtime compiler. Use this if you are using a bundler but still want locale messages compilation (e.g. templates via inline JavaScript strings). To use this build, change your import statement to: import { createI18n } from "vue-i18n/dist/vue-i18n.esm-bundler.js";
:::tip NOTE
If you use vue-i18n.runtime.esm-bundler.js
, you will need to precompile all locale messages, and you can do that with .json
(.json5
) or .yaml
, i18n custom blocks to manage i18n resources. Therefore, you can be going to pre-compile all locale messages with bundler and the following loader / plugin.
vue-i18n.cjs(.prod).js
:
require()
target: 'node'
and properly externalize vue-i18n
, this is the build that will be loadedprocess.env.NODE_ENV