diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-01 07:03:23 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-02 17:26:07 +0200 |
commit | 5cec23d840ed0adc10ea717a59df4e42bfbdbf30 (patch) | |
tree | 699e931aa04f292f686249ba0fcb6f3de436fb1c /settings/src | |
parent | c2ef47ee13799bf0b5a0dbe97e54a021c888d8eb (diff) | |
download | nextcloud-server-5cec23d840ed0adc10ea717a59df4e42bfbdbf30.tar.gz nextcloud-server-5cec23d840ed0adc10ea717a59df4e42bfbdbf30.zip |
Babel fix and dynamic import on settings
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'settings/src')
-rw-r--r-- | settings/src/main.js | 13 | ||||
-rw-r--r-- | settings/src/router.js | 6 |
2 files changed, 15 insertions, 4 deletions
diff --git a/settings/src/main.js b/settings/src/main.js index e8171c95ba3..ef27162942e 100644 --- a/settings/src/main.js +++ b/settings/src/main.js @@ -19,17 +19,26 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ +import "@babel/polyfill"; import Vue from 'vue'; import { sync } from 'vuex-router-sync'; import App from './App.vue'; import router from './router'; import store from './store'; -require("babel-polyfill"); - sync(store, router); +// CSP config for webpack dynamic chunk loading +// eslint-disable-next-line +__webpack_nonce__ = btoa(OC.requestToken) + +// Correct the root of the app for chunk loading +// OC.linkTo matches the apps folders +// OC.generateUrl ensure the index.php (or not) +// eslint-disable-next-line +__webpack_public_path__ = OC.generateUrl(OC.linkTo('settings', 'js/')) + // bind to window Vue.prototype.t = t; Vue.prototype.OC = OC; diff --git a/settings/src/router.js b/settings/src/router.js index 66213b02b56..efa79337978 100644 --- a/settings/src/router.js +++ b/settings/src/router.js @@ -23,8 +23,10 @@ import Vue from 'vue'; import Router from 'vue-router'; -import Users from './views/Users'; -import Apps from './views/Apps'; + +// Dynamic loading +const Users = () => import('./views/Users'); +const Apps = () => import('./views/Apps'); Vue.use(Router); |