Questions tagged [webpack-bundle]

9 questions
5
votes
0 answers

How to detect whether my code is executed as a Webpack bundle

I'm currently experimenting with the following strategy to dynamically load a json file from a path relative to my module : If my code is bundled as a Webpack bundle, use import(filename.json) In any other case, fall back to an AJAX call, with an…
John Slegers
  • 45,213
  • 22
  • 199
  • 169
3
votes
0 answers

Webpack creates multiple bundle files prefixed with number

I am new to webpack and using it to bundle my react application to a single bundle file. However, when I run npx webpack command, it creates multiple bundle files prefixed with some random number. Is there any webpack config which can help me avoid…
3
votes
0 answers

Computing asset size from module sizes in webpack stats file

The stats.json file created by Webpack, is laid down such that, one or modules make up a chunk, and one or more chunks make up an asset. I am trying to compute the size of the asset by summing the sizes of the modules that (make up the chunks…
tubby
  • 2,074
  • 3
  • 33
  • 55
3
votes
2 answers

react antd large production bundle

Webpack outputs a very large bundle: 1.5MB minimized. I import single components according to the docs, using imports 'antd/lib/...' These are my imports: import React from "react"; import ReactDOM from "react-dom"; import TreeSelect from…
user3599803
  • 6,435
  • 17
  • 69
  • 130
2
votes
2 answers

Html-loader + file-loader not bundling the correct image source

I'm planning to use Webpack for a project and I'm setting up my workflow with Html-loader + file-loader to get a production html file with dynamic src for the images, as Colt Steele teaches in this video. Here are my src/ files: index.html
1
vote
1 answer

Config webpack-bundle-tracker from vue.config.js to quasar.conf.js

I have a Vuejs app running with this configuration: const BundleTracker = require("webpack-bundle-tracker"); module.exports = { // on Windows you might want to set publicPath: "http://127.0.0.1:8080/" publicPath: "http://0.0.0.0:8080/", …
Gustavo Sooeiro
  • 327
  • 6
  • 17
1
vote
0 answers

Dynamically inject webpack react bundle into a running page

I have a react webpack bundled page wrapper that looks like this: +-----------------------------------+ | HEADER | +-----------------------------------+ | | | …
TacB0sS
  • 10,106
  • 12
  • 75
  • 118
0
votes
0 answers

How to configure webpack to only add script files at run time and remove previously added files in the bundled file "bundle.js"

I am new to webpack and stack oveflow too. currently I am using webpack to bundle css and script files/modules into single "bundle.js" file. Here is the code snippet (of concern) in the "index.js" file. import loadPage from "./load-page.js"; //…
0
votes
1 answer

Order of exports in webpack bundle

For code like this: const top = document.createElement("div"); top.innerText = "This is the top"; top.style = red; export { top }; Webpack creates the following: ... "use…
stratis
  • 7,750
  • 13
  • 53
  • 94