1👍
To have a separate script tag without going through the webpack processing, you should take it out of the src
and move it to the public
directory and add the script tag to the index.html
. If you structure your config in such a way that it is available as a global object (for e.g., document.myAppConfig
), then you can access the config values without having to do an import
.
Edit: As commented, the config file that is shown is dependent on the BUILD process and can’t be expected to be regenerated without rebuilding the project. However the closest one can get to achieving the flexibility of editing the configuration after building is to use the import()
function instead of the ES6 import config from "config.js"
module format.
If you can find a way to import the configuration like this
config: () => import(/* webpackChunkName: "config" */ "./config.js")
this would generate a separate chunk that you can later edit independently.
CAVEAT: This would create problems for the users due to web browsers caching resources.
- [Vuejs]-Vue variables are not set after I get them from api
- [Vuejs]-How to change css background in vue js?