You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bundles are generated as below to align with Vue 3 bundles.
12
+
13
+
-`vuex.global(.prod).js`
14
+
- For direct use via `<script src="...">` in the browser. Exposes the Vuex global.
15
+
- Note that global builds are not UMD builds. They are built as IIFEs and is only meant for direct use via `<script src="...">`.
16
+
- Contains hard-coded prod/dev branches, and the prod build is pre-minified. Use the `.prod.js` files for production.
17
+
-`vuex.esm-browser(.prod).js`
18
+
- For usage via native ES modules imports (in browser via `<script type="module">`.
19
+
-`vuex.esm-bundler.js`
20
+
- For use with bundlers like `webpack`, `rollup` and `parcel`.
21
+
- Leaves prod/dev branches with `process.env.NODE_ENV` guards (must be replaced by bundler).
22
+
- Does not ship minified builds (to be done together with the rest of the code after bundling).
23
+
-`vuex.cjs.js`
24
+
- For use in Node.js server-side rendering via `require()`.
25
+
26
+
#### Typings for `ComponentCustomProperties`
3
27
28
+
Vuex 4 removes its global typings for `this.$store` within Vue Component due to solving [issue #994](https://github.com/vuejs/vuex/issues/994). When using TypeScript, you must provide your own augment declaration.
29
+
30
+
Please place the following code in your project to have `this.$store` working.
Copy file name to clipboardExpand all lines: README.md
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,23 @@ app.use(store)
44
44
app.mount('#app')
45
45
```
46
46
47
+
### Bundles are now aligned with Vue 3
48
+
49
+
The bundles are generated as below to align with Vue 3 bundles.
50
+
51
+
-`vuex.global(.prod).js`
52
+
- For direct use via `<script src="...">` in the browser. Exposes the Vuex global.
53
+
- Note that global builds are not UMD builds. They are built as IIFEs and is only meant for direct use via `<script src="...">`.
54
+
- Contains hard-coded prod/dev branches, and the prod build is pre-minified. Use the `.prod.js` files for production.
55
+
-`vuex.esm-browser(.prod).js`
56
+
- For usage via native ES modules imports (in browser via `<script type="module">`.
57
+
-`vuex.esm-bundler.js`
58
+
- For use with bundlers like `webpack`, `rollup` and `parcel`.
59
+
- Leaves prod/dev branches with `process.env.NODE_ENV` guards (must be replaced by bundler).
60
+
- Does not ship minified builds (to be done together with the rest of the code after bundling).
61
+
-`vuex.cjs.js`
62
+
- For use in Node.js server-side rendering via `require()`.
63
+
47
64
### Typings for `ComponentCustomProperties`
48
65
49
66
Vuex 4 removes its global typings for `this.$store` within Vue Component due to solving [issue #994](https://github.com/vuejs/vuex/issues/994). When using TypeScript, you must provide your own augment declaration.
- The code is kept as close to Vuex 3 code base as possible, and there're plenty of places where we should refactor. However, we are waiting for all of the test cases to pass before doing so (some tests require Vue 3 update).
71
-
- TypeScript support is not ready yet. Please use JS environment to test this for now.
0 commit comments