464 questions
1
vote
2
answers
257
views
react code splitting: is the argument for the import() function not a string
This is very bizarre. During my attempt at code-splitting, I encountered this:
const g = "bi";
const importStr = `react-icons/${g.toLowerCase()}`;
console.log(importStr);
console.log(...
0
votes
1
answer
141
views
preloading images and fonts conflict with code splitting
I'm using react +17.0 and the craco (module bundler)
similar to this post,
When I'm trying to preload some images/fonts on my index.html with:
<link rel='preload' as='image' href='assets/images/...
0
votes
1
answer
6k
views
Next.JS unused javascript slow performance
I am doing my first website with Next.Js and after I do the lighthouse test I get really bad performance score. It says it is for unused JavaScript. Those files are in the chunk folder. I read a lot ...
0
votes
0
answers
2k
views
Where do I look to solve a ChunkLoadingError: Loading chunk nameofchunk failed in a Vue application?
My application is working fine on my development machine, but once I run
npm run production (it compiles successfully) and upload the chunks onto the production server, I get an error of the form:
[...
1
vote
0
answers
330
views
Webpack entry point per component
I am creating Angular application, which for my use case, does not require routing, and the output of the build process needs to be broken down per component or per module.
Angular compiles into main, ...
0
votes
1
answer
390
views
How to add a loadingLomponent or errorComponent to Vue3 in TypeScript via code splitting/lazy loading
I want to add a loading spinner component, as long as the data from the api has not arrived.
I worked before in Vue2 + JavaScript and are super new to Vue3 + TypeScript.
I tried to archive it like ...
0
votes
1
answer
328
views
Is it possible to use webpack dynamic imports with rails asset pipeline?
My problem is that after the bundles are emitted by webpack, rails assets pipeline adds hashes to the file names so it's impossible to dynamically import them
My current setup is
import modal from &...
1
vote
1
answer
304
views
How does code splitting actually work? (and how can I code split with django?)
I'm using Django to serve HTML files, with a react application inside one of them. The application is too large and I would like to implement code splitting. This is simple enough to do with webpack, ...
0
votes
0
answers
241
views
Preact and react-redux bug with dynamic loading
I'm working with preact, and loading a module dynamically within my code, using webpack code-splitting.
If I load my core bundle using a script tag, everything works perfectly. If I load it ...
0
votes
0
answers
289
views
All bundles load on every page load React + Java
I have react + java application.
I have used lazy loading to spilt the pages in multiple js blocks.
Multiple entries are present in index.html in script tag:
<body>
<div id="react&...
1
vote
1
answer
378
views
Shared angular modules not landing in webpack common chunk
I have a lot of angular modules that are reused in the entire application, e.g.
I18nModule
StringInputModule
...
After building the app via angular CLI and inspecting the bundle with webpack bundle ...
0
votes
0
answers
134
views
React Code Splitting using react-loader custom webpack config not working
So i followed this article to setup my custom webpack config https://www.toptal.com/react/webpack-react-tutorial-pt-1 .
And used React-router based code splitting using react-loader.
Below is the ...
0
votes
0
answers
285
views
Code splitting in Next JS 3 to get smaller bundle size in Lighthouse
I had an app under Next Js 3.2.3 which I currently analyze and improve to get higher score in Google Lighthouse. It currently receive bad audit on JS bundle size, which shows that 90% of the main ...
4
votes
0
answers
735
views
How can I prevent duplication on chunks when I use dynamic imports?
I will contextualize my question with some example code. I created a new project using CRA (not ejected).
I have this on App.js:
import React from "react";
import "./App.css";
...
0
votes
0
answers
638
views
How do I use an entire cacheGroup as an entrypoint in webpack?
My webpack.config has entrypoints defined like this
config.entry = {
'assessment-tile-view': { import: './assessment-tile-view/index.js', dependOn: 'vendors' },
'assessment-tile-config': { ...
0
votes
1
answer
95
views
What's the difference between node_modules\@firebase and node_modules\firebase packages?
I'm working on my code splitting logic and I want to split firebase chunks.
So I'm logging out the module.context on my splitChunks configuration on webpack.config.ts
webpack.config.ts
optimization: {
...
1
vote
1
answer
949
views
Reduce Vue Bundle Size, and increase Vue Performance
I have big issue on vue performance on initial load time and size, picture below shown the vue-plotly is the main factor. However, I didn't use the vue-plotly package but my vue-pivottable(Pivot Table ...
2
votes
1
answer
2k
views
What is the point of single page large applications if you have to split your code to improve performance?
I've been reading about lazily loading code in react.
With lazy loading, only the needed code will be loaded and doing so,
your initial loading will be faster (because you will load much less
code) ...
3
votes
0
answers
1k
views
How to put entry name in chunk filename? (webpack)
My files:
page1.js
import nameFunction from "./nameHelper"
page2.js
import nameFunction from "./nameHelper"
import users from "./users"
page3.js
import users from "...
2
votes
0
answers
786
views
Dynamic imports not working with Webpack 4 + React + @loadable/component
I have a project that uses React with Webpack 4, Babel and TypeScript. I'm trying to have code splitting and installed @loadable/component for that. Unfortunately when I call loadable(() => import(....
-1
votes
3
answers
7k
views
Splitting a string after a specific character in python [duplicate]
I wanna split everything comes after = and assigning it into a new variable
example:
https://www.exaple.com/index.php?id=24124
I wanna split whatever comes after = which's in this case 24124 and put ...
0
votes
1
answer
533
views
Laravel webpack vue code splitting lazy routes are not versioned
I'm working on a Laravel + Vue SPA project and I tried to optimize the project with code splitting and defining lazy routes, but now every lazy route file are not being versioned.
Let's see if I can ...
1
vote
0
answers
36
views
Preserving a module's code splitting when importing it
I am using Webpack to build an NPM module. It has several modules inside it that are dynamically imported. In the production build step, this means it generates about 8 JavaScript files.
When you npm ...
3
votes
2
answers
2k
views
using react lazy in CRA with cssmodules causes chunks to have duplicate css in production
I'm having similar issue seen here Webpack chunk styles and react.lazy.
I'm using react lazy to with react-router to make route based code-splitting. I have reusable component called Block which uses ...
0
votes
1
answer
261
views
Rendering a dynamically loaded React component
`Here is my attempt to dynamically load a component at the click of a button, and show on page.
https://codesandbox.io/s/sweet-haze-knste?file=/src/App.tsx
I am using the below line of code to ...