Questions tagged [webpack-config]

42 questions
12
votes
0 answers

What are the differences between `test`, `include`, `resource` attributes in webpack modules rules configuration?

In webpack.config.js to determine module we can use 3 different attributes: ... module:{ rules: [ { test: ... // the first one, commonly used in most example we can found on internet include: ... // the second…
Sonny D
  • 897
  • 9
  • 29
3
votes
0 answers

Removing runner settings from Task Runner Explorer webpack.config.js in Visual Studio 2019

In my Task Runner Explorer, There are too many runner settings(Run, Profile, Serve, Watch). For each of the categories, there are 4 items, the one I actually use is the one before the last one of the Watch category. Is there a way to remove the rest…
3
votes
1 answer

Error: while using devtool="source-map" option in webpack config version 5

I am getting this error while using "source-map" as value to the devtool option in webpack configurations but while using "eval" it works (but I don't want "eval"). It could be a chance that asset can be undefined or not an array. I am new to…
hitendra
  • 159
  • 2
  • 9
3
votes
1 answer

Webpack: Can't display SVG images with file-loader (svg parse error)

SVGs that I use using require doesn't get displayed. In my terminal, svg assets gets emitted and paths were set properly in my html. However, the SVG won't display while…
Julius Guevarra
  • 690
  • 1
  • 7
  • 19
3
votes
1 answer

Migrating postcss-loader from 3.0.0 to 4.0.2 results in Error: [object Object] is not a PostCSS plugin

So Today I have been trying to migrate postscss-loader from version 3.0.0 to 4.0.2 I noticed since verion 4.0.0 they added postCSS as a peer dependency so I've added postcss version 7.0.27. I did not go for 8 as I also use 'postcss-import' and this…
BonifatiusK
  • 2,281
  • 5
  • 29
  • 43
2
votes
0 answers

Webpack injecting wrong file names

Webpack is injecting script file names into my HTML file that are different from the names of the files it is actually generating. I have a home page HTML file with these script tags:
Rick Kirkham
  • 9,038
  • 1
  • 14
  • 32
2
votes
1 answer

chunks.some is not a function

I have just upgraded from webpack 4 to webpack 5 but now when I try to build my solution, it's throwing the following error: TypeError: chunks.some is not a function This is the line in my webpack.config: optimization: { splitChunks: { …
Pete
  • 57,112
  • 28
  • 117
  • 166
1
vote
0 answers

How to use SCSS absolute import path in a React, Webpack, Typescript Project?

I have been trying to import SCSS files with an absolute path for 2 days now... My folder structure: src |--assets |--|--styles |--|--|--_variables.scss |--UI |--|--Layout.module.scss I would like to import variables and functions from…
Aaron
  • 11
  • 2
1
vote
0 answers

Why are changes not recognized on any config (tsconfig, webpack, babel) when stopping and restarting dev server?

In my React project it seems when I alter these configurations there is no effect. My goal is to add import aliases. I made sure all the paths are correct many times over so I believe that is not the issue. Attempts included adding "baseUrl":…
1
vote
0 answers

Showing react app in my HTML Javascript app

I have a react app and I have generated a bundle.min.js by creating webapack.config.js which looks like the following: const path = require('path'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const glob =…
Tan
  • 1,433
  • 5
  • 27
  • 47
1
vote
0 answers

react css overiding classes from different files

I have a react project where i am using a header component which is as follows - import React from "react"; import "./index.scss"; const Headers = () => return (
Naruto
  • 53
  • 8
1
vote
0 answers

next.js Can we set 'public' folder path from next.config.js file?

I have a Next.js SSG application that generates two static sites by providing different env variables during export. Can I have two different public folders for these two sites? Can I set public folder inside next.config file?
booleanMonk
  • 43
  • 1
  • 4
1
vote
1 answer

Set multiple entries using react-app-rewired

Below are some options from an open-webpack (not CRA) react project: // webpack.config.js module.exports = { // ... entry: { main: './src/index.js', 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', …
Mir-Ismaili
  • 13,974
  • 8
  • 82
  • 100
1
vote
2 answers

In Angular, using WebPack 5 Module Federations, how can we expose Web Workers used by a remote?

in my configuration I am currently using a shell application and a remote, both written in angular 12.2.0, and I'm facing a problem I am not sure how to solve. SHELL webpack.config.js const ModuleFederationPlugin =…
1
vote
0 answers

How to automatically clear cache on user's already loaded website whenever a new build is generated?

I am using this react boilerplate code - https://github.com/react-boilerplate/react-boilerplate and webpack - https://webpack.js.org/configuration/ The problem I am facing is whenever I am doing npm run build and pushing the build folder to prod,…
anoniket
  • 271
  • 1
  • 2
  • 11
1
2 3