From 96805737812ae8a12962290c177a78bc32a97e20 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Tue, 29 Jan 2019 13:47:00 +0530 Subject: [PATCH] refactor(dependencies): bundle Vue by default --- .eslintrc | 1 + frappe/public/build.json | 1 + frappe/public/js/frappe/views/modules_home.js | 13 +++++-------- frappe/public/js/frappe/views/pageview.js | 15 ++++++--------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.eslintrc b/.eslintrc index 46a4f4be8d..4b7dcf3457 100644 --- a/.eslintrc +++ b/.eslintrc @@ -120,6 +120,7 @@ "md5": true, "$": true, "jQuery": true, + "Vue": true, "moment": true, "hljs": true, "Awesomplete": true, diff --git a/frappe/public/build.json b/frappe/public/build.json index b48ee2a56c..a662892907 100755 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -133,6 +133,7 @@ "public/js/lib/Sortable.min.js", "public/js/lib/jquery/jquery.hotkeys.js", "public/js/lib/bootstrap.min.js", + "public/js/lib/vue/dist/vue.js", "node_modules/moment/min/moment-with-locales.min.js", "node_modules/moment-timezone/builds/moment-timezone-with-data.min.js", "public/js/lib/socket.io.min.js", diff --git a/frappe/public/js/frappe/views/modules_home.js b/frappe/public/js/frappe/views/modules_home.js index a00a40a2b5..a075d59d15 100644 --- a/frappe/public/js/frappe/views/modules_home.js +++ b/frappe/public/js/frappe/views/modules_home.js @@ -11,13 +11,10 @@ frappe.modules.Home = class { } make_body() { this.$modules_container = this.$parent.find('.layout-main'); - frappe.require('/assets/js/frappe-vue.min.js', () => { - Vue.prototype.__ = window.__; // eslint-disable-line - // eslint-disable-next-line - new Vue({ - el: this.$modules_container[0], - render: h => h(Modules) - }); + Vue.prototype.__ = window.__; + new Vue({ + el: this.$modules_container[0], + render: h => h(Modules) }); } setup_header() { @@ -25,4 +22,4 @@ frappe.modules.Home = class { // subtitle } -}; \ No newline at end of file +}; diff --git a/frappe/public/js/frappe/views/pageview.js b/frappe/public/js/frappe/views/pageview.js index 228d799d43..8c3a0d6b44 100644 --- a/frappe/public/js/frappe/views/pageview.js +++ b/frappe/public/js/frappe/views/pageview.js @@ -48,14 +48,11 @@ frappe.views.pageview = { let container = $('
').appendTo(page); container = $('
').appendTo(container); - - frappe.require('/assets/js/frappe-vue.min.js', () => { - Vue.prototype.__ = window.__; // eslint-disable-line - // eslint-disable-next-line - new Vue({ - el: container[0], - render: h => h(Desktop) - }); + + Vue.prototype.__ = window.__; + new Vue({ + el: container[0], + render: h => h(Desktop) }); return; } @@ -185,5 +182,5 @@ frappe.views.ModulesFactory = class ModulesFactory extends frappe.views.Factory }); } }; - +