diff options
author | Grigorii Shartsev <grigorii.shartsev@nextcloud.com> | 2023-03-14 10:01:41 +0100 |
---|---|---|
committer | Grigorii Shartsev <grigorii.shartsev@nextcloud.com> | 2023-03-14 10:02:12 +0100 |
commit | 13472d0e86406d82c02259ce1ed7a9b728c501bc (patch) | |
tree | f8b9e0e066ee69fb6933dd3ed14b19e49714e341 /src/main.js | |
parent | 7bf0ca9e23bc18487140c02d7c19d568391772e3 (diff) |
feat(desktop): prepare webpack config for desktop
- Define IS_DESKTOP global variable
- Separate the config to common and web parts
- Use cross-platform slashes on webpack rules' tests
Signed-off-by: Grigorii Shartsev <grigorii.shartsev@nextcloud.com>
Diffstat (limited to 'src/main.js')
-rw-r--r-- | src/main.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main.js b/src/main.js index 372fce1df..6fee9587a 100644 --- a/src/main.js +++ b/src/main.js @@ -52,16 +52,18 @@ import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility // eslint-disable-next-line import 'leaflet-defaulticon-compatibility' -// CSP config for webpack dynamic chunk loading -// eslint-disable-next-line -__webpack_nonce__ = btoa(getRequestToken()) - -// Correct the root of the app for chunk loading -// OC.linkTo matches the apps folders -// OC.generateUrl ensure the index.php (or not) -// We do not want the index.php since we're loading files -// eslint-disable-next-line -__webpack_public_path__ = generateFilePath('spreed', '', 'js/') +if (!IS_DESKTOP) { + // CSP config for webpack dynamic chunk loading + // eslint-disable-next-line + __webpack_nonce__ = btoa(getRequestToken()) + + // Correct the root of the app for chunk loading + // OC.linkTo matches the apps folders + // OC.generateUrl ensure the index.php (or not) + // We do not want the index.php since we're loading files + // eslint-disable-next-line + __webpack_public_path__ = generateFilePath('spreed', '', 'js/') +} Vue.prototype.t = translate Vue.prototype.n = translatePlural |