Questions tagged [webpack]
Webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it can also transform, bundle, or package just about any resource or asset. Webpack takes modules with dependencies and generates static assets representing those modules. Webpack enables extensibility and promotes best practices in web architecture and performance.
webpack
42,764
questions
0
votes
1
answer
13
views
How to use repack build multi bundle?
I'm trying to use repack in React Native to split my codebase into multiple bundles, but I'm facing some challenges. I've installed repack following the documentation and attempted some configurations,...
0
votes
0
answers
14
views
TS target config does not support browserlist
It seems TS target config does not support browserlist's browsers versions like "Chrome >= 48", found related issue#19183 and issue#53373.
I created a utils package, currently, I set the ...
0
votes
0
answers
19
views
My webpack is building old lodash version
I'm having some troubles with my webpack when building source for deployment. Built files are always created with [email protected]. How can I exclude the lodash from the build process or upgrade it to ...
0
votes
0
answers
17
views
How to correctly configure package dependancy for microfrontends using webpack and react?
I have project with microfrontend using react and webpack. In the container app also I am using antd library. Then I created the microfrontend app and used as remoteEntry in container app. I was able ...
0
votes
1
answer
18
views
How do I find out what causes a "Debug Error" in TypeScript's compiler?
When running nx serve (using NRWL NX) on my TypeScript project, the build now fails with this error:
<my-file>.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/...
1
vote
0
answers
38
views
Utilize react component over URLs dyanamically
I have a React component say TEST.TSX , I have compiled the .tsx file to .js and uploaded it to GitHub, so that I can server it over JsDelivr. Can I use the CDN in another react app to utilize the ...
1
vote
0
answers
22
views
Angular - esbuild chunk names
I just upgraded an Angular app from v17 to v18, and during the process I made the move from using webpack to now building with esbuild.
Im trying to understand the code splitting and chunk names with ...
1
vote
0
answers
4
views
Alternatives to libInjectCss from vite-plugin-lib-inject-css
I'm on the process of building a Vite application and I can see that the build generates three files which are significantly big.
myProject.js 37kb
myProject.umd.js 3671kb
main.css 3657kb
This is ...
0
votes
0
answers
10
views
TypeScript project can't find UMD module during import
I created a library of React components built with TypeScript and compiled into UMD using Webpack. When I try to import one of those components into a separate TypeScript project, I get the following ...
0
votes
0
answers
15
views
Can Microfrontend Modules Run Independently Without a Host Application? [closed]
Can a microfrontend module be designed to run independently, without relying on a host app to load or manage it?
I'm using React, Webpack, and various CSS-related dependencies.
I want to ensure ...
0
votes
0
answers
22
views
Building JSX in a WordPress plugin, can't get Webpack to watch / build from assets folder into dist?
I started to create a new Wordpress plugin and want to know what is a good structure/way to implement a build of my all javascript files (keeping their directory structure in the dist/build folder) ...
0
votes
0
answers
27
views
Missing loader using MUI date picker storybook
I am unable to use MUI date picker in a storybook with the below error
ERROR in
./node_modules/@mui/x-date-pickers/DesktopTimePicker/DesktopTimePicker.js
45:52 Module parse failed: Unexpected token (...
0
votes
0
answers
18
views
Invalid hook call in react-redux provider
I am trying to migrate from Parcel 1.0 to Webpack 4, I am using React 16.14, Node: 18.20, Npm 10.7.
Getting below error when running webpack serve
Invalid hook call. Hooks can only be called inside of ...
0
votes
1
answer
24
views
Dynamic require of 'https' is not supported error while generating cypress cucumber report in v 10
✘ [ERROR] Could not resolve "https"
node_modules/@ng-apimock/cypress-plugin/dist/cypress.plugin.js:4:22:
4 │ const https = require("https");
╵ ~~~~~~~
...
0
votes
0
answers
21
views
Vue3 Openlayers + webpack = can't resolve modules
webpack fails to resolve modules dependencies when compiling
I got 94 erros like this:
ERROR in ./node_modules/vue3-openlayers/dist/vue3-openlayers.es.js 63:0-41
Module not found: Error: Can't resolve ...
0
votes
0
answers
30
views
'stats' not allowed in Vue 3 cli?
I am trying to generate a stats report for my Vue 3 project. There is no way I can enable stats. I currently use webpack-bundle-analyzer to view a map of the bundles, but enabling a report for it ...
1
vote
0
answers
31
views
Error: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function [closed]
I'm new to next.js and I'm facing this error from past two days but can't find any way to debug it:
Error: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
after deep research,...
0
votes
0
answers
25
views
HTML Bundler Webpack Plugin: Source Tag Error
I am working on a photography portfolio website that I was originally building with the HTML Webpack Plugin, but recently decided to attempt to rebuild it with the newer HTML Bundler Webpack Plugin.
I'...
0
votes
0
answers
13
views
How to configure django templates and webpack
I am using a django project created by django-cookiecutter template.I want to use webpack to bundle my js files (normal js) and css files..previously I used django-compressor to compress css files.
I ...
1
vote
0
answers
34
views
How to get url path for CSS at runtime?
I use CSS Modules.
I don't need resolving of url, but I need replace url paths with my custom function call so that I could get the full url at runtime by myself with my custom logic.
For example,
&...
0
votes
0
answers
22
views
Excluding dependencies from bundle (NextJS & Turbopack)
I am using package in my NextJS which includes modules for React Native that need to be excluded. As part of a migration to move to Turbopack from Webpack, I need to find a way to exclude these ...
0
votes
0
answers
19
views
Framework7 Core with bundler (Vite) build on Capacitor cannot work on Android
I created a sample package with source code by using command "framework7 create --ui", then generate couples of files and folders and load them on VScode. The package is built at the ...
1
vote
1
answer
24
views
Webpack configuration not working for jsx file with babel lorder
When runing the react project which is configured with webpack and babel loder is giving and error saying unexpected token in jsx files.Please find bellow error snippit
ERROR in ./src/index.js 10:12
...
0
votes
0
answers
23
views
Icon Component with Dynamic SVG Imports vs Bundle Size next.js - v14.2.3
I am trying to create an Icon component in a Next.js application that imports SVGs dynamically without significantly increasing the bundle size. Despite using various methods such as require.context(),...
1
vote
1
answer
32
views
Word runs both my source js file and the webpacked file, making all functions run twice (Office JS Yeoman)
Both taskpane.js and a packed version of the same file (75af049aa831360ba2a0.js) are running at the same time in my Office JS Add-in. I only want my file/functions to be run once.
Here is my webpack....
0
votes
0
answers
34
views
How to Reduce Build Size in React App with CRA Build?
I'm trying to optimize the build size of my React app. Currently, I am using gzip compression with the CRA build, without using Webpack or Rollup. My current build size with gzip is 4.6 MB, and ...
-1
votes
0
answers
14
views
Using Material Tailwind with Craco
I'm using craco and material tailwind in my react typescript project. I can render and use some components like Button, Card, ... but when I wanna use Tabs and its dependencies my app is crashed and ...
0
votes
0
answers
6
views
Next 13.5.2 does not resolve ESM modules correctly in imported packages
I import package A in a Next JS application.
Package A imports an icon from @mui/icons-material like this import Icon from "@mui/icons-material/Icon".
This causes an error, as Icon looks ...
-1
votes
0
answers
18
views
How to Output NOTICE File Included in the License with a Plugin Like license-webpack-plugin? [closed]
I would like to output the NOTICE file included in the license, similar to this plugin. Is there a way to do this? Or are there any similar packages available?
https://github.com/xz64/license-webpack-...
0
votes
0
answers
9
views
Serve the source for a module required from a webpack bundle
I have a vscode extension that is bundled using webpack. Referencing an npm package with import or require causes it and its dependencies to be bundled as expected.
Some of these bundled assets are ...
-1
votes
0
answers
36
views
Export all classes and functions to one namespace like in Lodash
In Lodash all function are in the _ namespace. This namespace is located in the window. So we can access the namespace anywhere. Want to achieve the same but facing an issue. I have to export all my ...
0
votes
0
answers
35
views
CORS error when importing micro frontend on different domain
Some of my micro frontends are hosted on a different domain that requires authentication so when my SPA tries to access those they get a redirect which then results in a CORS error.
My browser is ...
-2
votes
0
answers
51
views
Error while running react - electron in browser - Uncaught ReferenceError: require is not defined
I am tryin to make a electron - react application and while running i am getting a error on the console of the browser.
Uncaught ReferenceError: require is not defined
at Object.events (bundle.js:...
-1
votes
0
answers
16
views
Webpack build failing Angular js
i am trying to create a angular build using webpack but getting style issues.
Here is my webpack.config.js file configuration
const ModuleFederationPlugin = require("webpack/lib/container/...
1
vote
1
answer
60
views
Export React as one inline HTML file
I am making one-page websites for particular service that accepts only single inline html files. I want to make these webpages as modularly as possible (to make many versions of them) and am thus ...
0
votes
0
answers
11
views
Getting Webpack 2 module parse error while trying to load launchdarkly-js-client-sdk
I am getting following error while trying to load launchdarkly-js-client-sdk using webpack 2:
ERROR in ./~/launchdarkly-js-client-sdk/dist/ldclient.es.js
Module parse failed: node_modules/launchdarkly-...
2
votes
0
answers
61
views
Webpack bundle analyser is not working in the project with angular 18 version
I am working on angular 18 framework and I recently tried to integrate webpack bundle analyser in my project but it's giving me a weird error.I thought the issue is with my project so created a new ...
0
votes
0
answers
16
views
How to automate license extraction for sub-packages when using license-webpack-plugin?
I am currently using the license-webpack-plugin, which works well to extract license information when the target repository has a LICENSE file. However, there is an issue when the target package is a ...
0
votes
0
answers
16
views
Switching from npm to Yarn Berry for a React App: Polyfill Issues
I'm new to React, npm, and Yarn. I'm trying to use Yarn Berry instead of npm for my React app.
I've followed this step-by-step solution and ran yarn set version berry before running the yarn command.
...
1
vote
0
answers
25
views
How to Deploy a Kotlin Multiplatform WebAssembly Project on a Web Server?
After building the project using JetBrains' official Kotlin Multiplatform Wizard and selecting only the Web option, I tried to deploy it on the server but only encountered a white screen.
What I Did
...
0
votes
0
answers
10
views
service worker doesn't work as expected doesn't return cached response instead fails
Hello I want to implement behavior when new deployed version to production doesn't make application crash for users that use that page.
E.g. User uses site , we deploy new version and after some time ...
0
votes
2
answers
25
views
Webpack compilation error with cypress-cucumber-preprocessor
Error Message: Webpack Compilation Error
Module parse failed: Unexpected token (1:15)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this ...
0
votes
0
answers
22
views
Why is my image not loading properly in my NPM React Package
I am developing a React component library for a Phone Frameset that holds screenshots of apps.
I'll provide the files with the project structure right now. Maybe the issue is from one of the config ...
0
votes
0
answers
30
views
NextJS: Error: Cannot find module from [dot]next folder even though the file exists
I have a simple next application where /admin route lists the records and /new route open the form and after submitting the records it again redirects to the /admin page.
When I land on the /admin ...
0
votes
0
answers
46
views
"You forgot to add 'mini-css-extract-plugin' plugin" when work with thread-loader
Try to use thread-loader with mini-css-extract-plugin. When run npm build script, got error:
> cross-env NODE_ENV=production webpack
assets by status 958 bytes [cached] 1 asset
runtime modules 663 ...
0
votes
0
answers
13
views
Sonata Admin assets webpack
I have
"sonata-project/admin-bundle": "^4.27.1",
"sonata-project/classification-bundle": "*",
"sonata-project/doctrine-orm-admin-bundle&...
0
votes
0
answers
30
views
Why Angular generates two components in the target javascript file?
I was investigating problem described here: https://github.com/angular/angular/issues/53592 as I have run into this for our 5 components. I have noticed (when debugging the angular core code) that the ...
0
votes
0
answers
23
views
Module not found: Error: Can't resolve 'provider_app/App' remote React modules
I'm trying to access React components from a consumer in a remote link. I'm using Module federation in Webpack 5 for this. Here's my code.
Provider App
App.js
import React from 'react'
function App() ...
0
votes
0
answers
23
views
How to expose a React component from host application to a module federated child application in Micro Front End Architecture?
I was exploring the Microfront End Architecture, and I found this very useful github repo https://github.com/nebarf/module-federation-react-router-dom
My usecase is I want to expose a component from ...
0
votes
0
answers
12
views
how to import a plugin to a Typescript electron app with plugin system manager?
i'm in the process of making an electron app that will support a plugin system that will not cause any changes in the app it will only load components which are the plugins i want to load.
and im ...