CommonsChunkPlugin is a webpack plugin that helps you bundle common code among your modules into separate bundles.
Questions tagged [commonschunkplugin]
72 questions
1
vote
0 answers
CommonsChunkPlugin doesn't work with electron
I have an electron app that I'm building with Webpack 2. I have a custom module (mymodule) that I want to be a separate bundle referenced by the other bundles. The problem is that when I use the CommonsChunkPlugin with my main process, electron…

d512
- 32,267
- 28
- 81
- 107
1
vote
1 answer
Webpack 2 - Suppress chunk files
As we are putting this output on a load balancer (not using sticky), we need to place the output of these files without chunks (neither hashes).
These are the main two files for webpack configuration.
webpack.common.js
const path =…

oscar.fimbres
- 1,145
- 1
- 13
- 24
1
vote
0 answers
webpack vendor chunk regenerates with no changes
I'm code splitting vendor and app into chunks via CommonsChunkPlugin. When I build twice I expect the vendor chunk to be unchanged, but it changes :(
Steps to replicate:
Clone https://github.com/mattcolman/webpack-vendor-chunk-test
Run yarn, then…

Matt Colman
- 69
- 6
1
vote
1 answer
Automatic vendor chunk with dynamic code splitting
How my application is split into chunks
My applications main and only entry chunk contains some common logic that is reused throughout the application such has layouting or helper methods and components related to authentication such as…

Codepunkt
- 532
- 4
- 15
1
vote
1 answer
Webpack & TypeScript CommonsChunkPlugin not working
I've followed a few guides to setting up CommonsChunkPlugin but it doesn't seem to be working. I've also searched and read the other posts on here but with no luck.
I have three files (TypeScript) which are importing a few of the same libraries…

descendent
- 13
- 3
1
vote
2 answers
Webpack 2: splitting libraries, vendor and app into different files
Imagine I have a rich application, which uses a lot of the 3rd party modules including lodash, moment, axios, react.
If I bundle everything in one bundle at the end the size would be higher then 1MB.
I want webpack to pack my libraries in the way,…

Pavel Polyakov
- 866
- 1
- 8
- 13
1
vote
0 answers
Why does webpack css loader add so many code to my bundle?
I have a typescript file called DropdownMenu.ts which looks like this
import DropdownMenuItem from './DropdownMenuItem';
import { createElem } from '../timeline/utils';
import { Dispatcher } from '../timeline/utils';
import { transition } from…

Trash Can
- 6,608
- 5
- 24
- 38
1
vote
0 answers
Using HtmlWebpackPlugin with CommonsChunkPlugin throws an error saying `Uncaught TypeError: Cannot read property 'call' of undefined`
When I use both HtmlWebpackPlugin and CommonsChunkPlugin in a webpack config,
I get an error saying Uncaught TypeError: Cannot read property 'call' of undefined.
Some people say that minChunks has not to be callback but Infinity.
But I just wanna…

Ryo Ikarashi
- 341
- 4
- 11
1
vote
1 answer
imported styles not loaded with ExtractTextPlugin
my styles are not loading when I use the following syntax
import '../styles/some-component.scss';
but they will load when I use modules like so (which makes sense that they should since I have the css-loader modules option set to true):
import…

Jordan
- 5,085
- 7
- 34
- 50
1
vote
1 answer
Is there a way to load react library files separately and not in the bundled files when using react with babel, webpack and gulp as building tool?
I have an application where I have to build code using babel and react. The application will be built using gulp and webpack for automated build creation and deployment. When using gulp and webpack to convert babel+react code to browser…

Aabhas Arora
- 23
- 5
1
vote
1 answer
webpack duplicate code in multi chunks and sooooo big common chunk file
duplicate code in multi chunks or sooooo big common chunk file
Suppose I have a SPA website. And I have a file main.js in which I config the route.
```js
define(function(){
// suppose I define route here
route.when('#/aaa', function(){
// a…

Wyntau
- 203
- 2
- 11
1
vote
1 answer
De-Duplicate libraries in app within deeply nested node modules
I have a app in which i can add modules as node_modules. Now, these modules and app uses a library XYZ as node module. Also, these modules have other node modules which has their own library XYZ as a node module.
So, this is roughly how the…

Cute_Ninja
- 4,742
- 4
- 39
- 63
0
votes
0 answers
Webpack chunk path breaks from 3.8.1 -> 4.43.0
I'm working on upgrading an inherited Webpack configuration from v.3.8.1 to v4.43.0, and I'm running into an odd issue with asynchronously loaded chunk files in the latest version. My Webpack output directory structure looks like this:
-…

flimsy
- 204
- 1
- 10
0
votes
1 answer
How to split a large sub file into a separate chunk in webpack 2
I'm trying to import a large file into a react project that is Chunked and Uglified by webpack 2.
Our code is split into chunks one of our chunks is 29MG. I want to exclude the large file from the chuck and to load that large file separately.
How do…

user2428524
- 108
- 1
- 2
- 9
0
votes
0 answers
How to perform Code splitting with CommonsChunkPlugin
This is my current bundle information which i got from bundle analyzer plugin,
Current bundle information
I want to move the jquery to a separate chunk and extract css into a separate single css bundle, is there any other optimization which i can do…

Sarva Raghavan
- 88
- 1
- 1
- 11