diff options
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); |