Webpack

Next.js bundle size is exploding as a result of dynamic component lookup, how to solve?

耗尽温柔 提交于 2021-02-18 20:12:48
问题 tldr: Check the repo - common.js includes all dependencies, even though, only one is used on the respective page. http://localhost:3000/components/ComponentOne http://localhost:3000/components/ComponentTwo Livedemo: click here More Details: I have an app (find attached a grossly simplified version) where based on a user input a different component is rendered. Finding the component to be rendered happens via a component-map. It makes sense that the common.js includes all dependencies for the

Next.js bundle size is exploding as a result of dynamic component lookup, how to solve?

霸气de小男生 提交于 2021-02-18 20:10:54
问题 tldr: Check the repo - common.js includes all dependencies, even though, only one is used on the respective page. http://localhost:3000/components/ComponentOne http://localhost:3000/components/ComponentTwo Livedemo: click here More Details: I have an app (find attached a grossly simplified version) where based on a user input a different component is rendered. Finding the component to be rendered happens via a component-map. It makes sense that the common.js includes all dependencies for the

Next.js bundle size is exploding as a result of dynamic component lookup, how to solve?

故事扮演 提交于 2021-02-18 20:09:05
问题 tldr: Check the repo - common.js includes all dependencies, even though, only one is used on the respective page. http://localhost:3000/components/ComponentOne http://localhost:3000/components/ComponentTwo Livedemo: click here More Details: I have an app (find attached a grossly simplified version) where based on a user input a different component is rendered. Finding the component to be rendered happens via a component-map. It makes sense that the common.js includes all dependencies for the

Next.js bundle size is exploding as a result of dynamic component lookup, how to solve?

安稳与你 提交于 2021-02-18 20:07:43
问题 tldr: Check the repo - common.js includes all dependencies, even though, only one is used on the respective page. http://localhost:3000/components/ComponentOne http://localhost:3000/components/ComponentTwo Livedemo: click here More Details: I have an app (find attached a grossly simplified version) where based on a user input a different component is rendered. Finding the component to be rendered happens via a component-map. It makes sense that the common.js includes all dependencies for the

How to debug an Angular CLI app with the custom webpack builder?

删除回忆录丶 提交于 2021-02-18 19:30:37
问题 I built a repo to expose my issue: https://github.com/franklin626/custom_webpack_undebuggable This Angular CLI app has a custom webpack setup ( webpack.config.js ). It also has a .vscode/launch.json configuration to debug from VS Code upon either ng test (unit tests) or ng serve . I can place breakpoints for my unit tests, but not when running ng serve : In my debug tab in VS Code, I run my "launch Chrome" routine followed by "attach localhost". I place a breakpoint on other.component.ts:14 ,

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory - webpack sample Angular 2

拜拜、爱过 提交于 2021-02-18 19:00:48
问题 I am facing an issue in webpack sample while getting webpack build: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory package.json "build": "rimraf dist && node_modules\\.bin\\webpack --config config/webpack.prod.js --progress --profile --bail", 回答1: Every single time when i got the same error i managed to solve the issue using the --max_old_space_size option. My guess would be that either --max_old_space_size=4096 is not enough (just use a higher value) or

Webpack and VueJs CLI v3 – Need relative path for images and web-fonts

自古美人都是妖i 提交于 2021-02-18 13:55:41
问题 Using: Vue CLI 3.0.0-rc.3 How can I config my app, that it is loading the A) css itself , B) the fonts loaded in css and C) the images from a relative path depending to the parent-folder the app is located? My complete vue app is currently running without extra webpack config file. I already know, I would need to create a webpack.config.js, but I don't know what plugins or configuration is necessary. The app is full functional under absolute path http:whatever.local/ of course. But I need to

How to use Webpack to combine JSON files from all subdirectories into one?

不问归期 提交于 2021-02-18 13:51:30
问题 Say I have a directory structured like this: 1. folder A 1a. some_file.js 1b. data.json 2. folder B 2a. folder B1 2a1. other_file.json 2a2. data.json 2b. folder B2 2b1. data.json 3. output.json Is there a webpack loader that can combine data.json in all subfolders, and output it to output.json ? I've found https://www.npmjs.com/package/json-files-merge-loader that seems to do something similar, but it seems to ask for each path to data.json , while I need something that goes through all

How to use Webpack to combine JSON files from all subdirectories into one?

℡╲_俬逩灬. 提交于 2021-02-18 13:51:29
问题 Say I have a directory structured like this: 1. folder A 1a. some_file.js 1b. data.json 2. folder B 2a. folder B1 2a1. other_file.json 2a2. data.json 2b. folder B2 2b1. data.json 3. output.json Is there a webpack loader that can combine data.json in all subfolders, and output it to output.json ? I've found https://www.npmjs.com/package/json-files-merge-loader that seems to do something similar, but it seems to ask for each path to data.json , while I need something that goes through all

Laravel Vue Non SPA - How to split the files for every page for its vue js components?

帅比萌擦擦* 提交于 2021-02-18 13:00:10
问题 My application is using laravel vue but not SPA,.. so im still using laravel blades to separate the pages. Every page are importing app.js. My App.js is compiled by webpack and all my vue components are compiled on that file. so the problem is the app.js getting MB size and the every page will slow to load that file. Is their way to split the code of vuejs or separate the file for every pages using webpack? this is my webpack.js in my web application. const mix = require('laravel-mix'); /* |-