I have a couple of functions that I need to add to Vue's .prototype. However, I don't want to clutter up the main.js file. I attempted to move the prototypes like this:
//main.js
import "./vue-extensions/prototypes";
//prototypes.js
import Vue from "vue";
export default new Vue.prototype({
$appName = "myName",
});
However, when I tried this approach, I encountered an error: `ERROR Failed to compile with 1 error 6:35:11 PM error in ./src/vue-extensions/prototypes.js
Syntax Error: D:\Projects\FrontEnd\gta\src\vue-extensions\prototypes.js: Unexpected token (3:19)
1 | import Vue from "vue"; 2 | export default new Vue.prototype({
3 | $appName = "myName",
@ ./src/main.js 14:0-37 @ multi (webpack)-dev-server/client?http://192.168.3.200:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js`