Skip to content

Commit 32a2336

Browse files
author
Dan
authored
docs: builds (#258)
Adding an example showing how to `import` from a different build. This is the one asked about most frequently on Stack Overflow, so I think it's nice to have in this section, but maybe it should go somewhere else.
1 parent 13498cd commit 32a2336

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Global builds are not [UMD](https://github.com/umdjs/umd) builds. They are built
110110
- This means you **can** install/import these deps individually without ending up with different instances of these dependencies, but you must make sure they all resolve to the same version
111111
- In-browser locale messages compilation:
112112
- **`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)
113-
- **`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)
113+
- **`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";`
114114
115115
:::tip NOTE
116116
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.

0 commit comments

Comments
 (0)