Skip to content

Commit d8beede

Browse files
committed
[v10] Move the __webpack_require__.p override inside main threads before the very first dynamic import #6838
1 parent a240f08 commit d8beede

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/Main.mjs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,6 @@ class Main extends core.Base {
252252

253253
DomAccess.onDomContentLoaded();
254254

255-
// We need different publicPath values for the main thread inside the webpack based dist envs,
256-
// depending on the hierarchy level of the app entry point
257-
if (environment === 'dist/development' || environment === 'dist/production') {
258-
__webpack_require__.p = config.basePath.substring(6)
259-
}
260-
261255
// Intended for the online examples where we need an easy way to add GA to every generated app
262256
if (config.useGoogleAnalytics && !mainThreadAddons.includes('AnalyticsByGoogle')) {
263257
mainThreadAddons.push('AnalyticsByGoogle')

src/main/DeltaUpdates.mjs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,19 @@ class DeltaUpdates extends Base {
6969
construct(config) {
7070
super.construct(config);
7171

72-
let me = this;
72+
let me = this,
73+
{environment} = NeoConfig;
7374

74-
if (Neo.config.renderCountDeltas) {
75+
if (NeoConfig.renderCountDeltas) {
7576
me.renderCountDeltas = true
7677
}
7778

79+
// We need different publicPath values for the main thread inside the webpack based dist envs,
80+
// depending on the hierarchy level of the app entry point
81+
if (environment === 'dist/development' || environment === 'dist/production') {
82+
__webpack_require__.p = NeoConfig.basePath.substring(6)
83+
}
84+
7885
// Initiate the asynchronous loading of the renderer here.
7986
me.#_readyPromise = (async () => {
8087
try {

0 commit comments

Comments
 (0)