chore(webpack): Move to shared code for entrypoints and use webpack serve public path

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-05-17 09:49:22 +02:00
committed by backportbot-nextcloud[bot]
parent c30bf3c936
commit 24d4d86aa4
8 changed files with 28 additions and 22 deletions

12
src/shared-init.js Normal file
View File

@@ -0,0 +1,12 @@
import { generateFilePath } from '@nextcloud/router'
// eslint-disable-next-line
__webpack_nonce__ = btoa(OC.requestToken)
if (!process.env.WEBPACK_SERVE) {
// eslint-disable-next-line
__webpack_public_path__ = generateFilePath('deck', '', 'js/')
} else {
// eslint-disable-next-line
__webpack_public_path__ = 'http://127.0.0.1:3000/'
}