Prefetched chunks ignore __webpack_public_path__ value

Bug report

What is the current behavior?

When marking a chunk with /* webpackPrefetch: true */ the value of __webpack_public_path__ is ignored and the value specified in webpack.config.js or the default is used instead. This is not the case for “normal” imports as well as /* webpackPreload: true */ imports, only prefetched imports are affected.

If the current behavior is a bug, please provide the steps to reproduce.

I made the existing test case for prefetch/preload stricter in my fork here. All the changed assertions pass, only the one on line 27 fails (it is the one for prefetched import).

Repro steps:

git clone https://github.com/no23reason/webpack.git
cd webpack
git checkout features/prefetch-public-path
yarn
yarn jest ConfigTestCases

What is the expected behavior?

I believe the prefetched chunks should respect the __webpack_public_path__ value, just like preloaded ones do.

Other relevant information:
webpack version: 4.16.1
Node.js version: 8.11.3
Operating System: macOS High Sierra 10.13.6
Additional tools: N/A

Author: Fantashit

2 thoughts on “Prefetched chunks ignore __webpack_public_path__ value

  1. @Rebulus unfortunatelly I haven’t, we had to stick to preload which is not ideal 😞 I still really don’t get why the behaviour is so different for preload and prefetch…

Comments are closed.