You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output contain a __webpack_require__.p which brings a full __webpack_require__ at the top.
// The module cachevar__webpack_module_cache__={};// The require functionfunction__webpack_require__(moduleId){// Check if module is in cachevarcachedModule=__webpack_module_cache__[moduleId];if(void0!==cachedModule)returncachedModule.exports;// Create a new module (and put it into the cache)varmodule=__webpack_module_cache__[moduleId]={exports: {}};// Execute the module function__webpack_modules__[moduleId](module,module.exports,__webpack_require__);// Return the exports of the modulereturnmodule.exports;}/************************************************************************/// webpack/runtime/public_path(()=>{__webpack_require__.p="/";})();/************************************************************************/constcircle_namespaceObject=__webpack_require__.p+"static/svg/circle.svg";constimage_namespaceObject=__webpack_require__.p+"static/image/image.png";console.log(circle_namespaceObject);console.log(image_namespaceObject);
We should remove this __webpack_require__ implementation to make output clearer.
A proper way to achieve this is to use generator.publicPath in asset module rules to avoid injecting runtime publicpath.
Timeless0911
changed the title
Should remove __webpack_require__.p in bundleless mode
Should remove __webpack_require__.p runtime in bundleless mode
Sep 20, 2024
What problem does this feature solve?
When we try to transform some files below in bundleless mode
The output contain a
__webpack_require__.p
which brings a full__webpack_require__
at the top.We should remove this
__webpack_require__
implementation to make output clearer.A proper way to achieve this is to use
generator.publicPath
in asset module rules to avoid injecting runtime publicpath.The output will be like
What does the proposed API look like?
generator.publicPath
for these asset module rules bytools.bundlerChain
The text was updated successfully, but these errors were encountered: