-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ES6 import from <script type="module"> tag inside browser #1247
Comments
FYI, you can use |
I think there's a problem with build process: vuex.esm.js should not refer to "process.env.NODE_ENV", this is why you got "ReferenceError: process is not defined"
Ugly workaround, add "process" to file header:
|
I have a PR up for a couple of months now in #1401 which seems to be popular in the community. Could any maintainer maybe take a look? |
What problem does this feature solve?
Using vuex in the browser is possible, by using a standard html
<script src='"vuex.js">
tag, but if you want to use something like mapGetters, it require something likeimport { mapGetters } from 'vuex'
. This is in theory possible in the browser by using a tag likebut appears to not work with vuex. Vue itself, using the vue.esm.browser.js bundle from unpkg works this way, but if vuex.esm.js is used it produces an error.
What does the proposed API look like?
import { ... } from 'vuex.esm.js'
should work inside the browser.The text was updated successfully, but these errors were encountered: