Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

md_imran's avatar

call minified version of jquery by require('jquery') method?

Hello Dears, I use

global.$ = global.jQuery = require('jquery');```, I saw its fetching
try {
  __webpack_require__.g.$ = __webpack_require__.g.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
  console.log($);
} catch (e) {
  console.log(e);
}

I want it should fetch jquery.min.js file to reduce the page load. how can I do that?

TIA, MD imran

0 likes
5 replies
tykus's avatar

Your overall build will be minified in production so the unminified version is just fine

md_imran's avatar

@tykus For page speed purpose, I need minified version for home page.

md_imran's avatar

@tykus yes, is there standard way to call node jquery min file in blade or js file or webpack file?

tykus's avatar

@md_imran if it is in the bundle then it is included in the app.js file.

Please or to participate in this conversation.