Skip to main content

All Questions

Tagged with
34 votes
5 answers
156k views

React Js require 'fs'

I have import fs from 'fs' and in my package.json I have Then I run the command > npm i fs > [email protected] node_modules/fs next in my React store I import 'fs' module import ...
joe's user avatar
  • 435
15 votes
4 answers
17k views

How to hash CSS class names in Nextjs?

How can I edit localIdentName field of css-loader in Webpack configuration in Nextjs so that I can hash/hide/obfuscate css class names? The example below is from the New York Times. Note the class ...
user9408899's user avatar
  • 4,422
8 votes
3 answers
13k views

How can I fix the "BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default" error?

I am trying to build a react app but each time I run npm start, I am greeted with this message Module not found: Error: Can't resolve 'buffer' in '/Users/abdus/Documents/GitHub/keywords-tracker/...
Abdus Shaikh's user avatar
244 votes
5 answers
170k views

What does this "react-scripts eject" command do?

What does the npm run eject command do? I do understand what other commands do like start, build, test. But no idea about eject.
Ishan Patel's user avatar
  • 5,901
225 votes
19 answers
416k views

How to use Google fonts in React.js?

I had built a website with React.js and webpack. I want to use Google fonts in the webpage, so I put the link in the section. Google Fonts <link href="https://fonts.googleapis.com/css?family=...
Kevin Hsiao's user avatar
  • 2,401
220 votes
22 answers
481k views

How to include bootstrap css and js in reactjs app?

I am new to ReactJS, I want to include bootstrap in my React app I have installed bootstrap by npm install bootstrap --save Now, want to load bootstrap CSS and JS in my React app. I am using webpack. ...
Mehul Mali's user avatar
  • 3,214
188 votes
35 answers
517k views

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema

I have this simple helloworld react app created from an online course, however I get this error: Invalid configuration object. Webpack has been initialised using a configuration object that does ...
Luis Valencia's user avatar
42 votes
10 answers
52k views

Importing CSS files in Isomorphic React Components

I have a React application with Components written in ES6 - transpiled via Babel and Webpack. In some places I would like to include specific CSS files with specific Components, as suggested in react ...
duncanhall's user avatar
  • 11.3k
24 votes
1 answer
14k views

Webpack output is empty object

I want to build a react component library as a node module to then import it into different projects. But if I try to import a component it just returns an empty object. button.jsx: import React, {...
SeBe's user avatar
  • 986
8 votes
4 answers
17k views

Uncaught TypeError: fs.readFileSync is not a function

I am trying to get webpack and mapbox-gl work together within Meteor system. I have look everywhere about the error mentioned above but none works. Here is my webpack setup { "root": "src", "...
Muhaimin's user avatar
  • 1,643
6 votes
1 answer
1k views

Value of "this" is incorrect when debugging Babel transpiled React with Chrome Devtools

I have a React application that is transpiled with Babel using the following .babelrc configuration { "presets": [ "es2015", "stage-1", "react" ], "plugins": [ "transform-...
Bob Cardenas's user avatar
129 votes
13 answers
164k views

Preset files are not allowed to export objects

I have a carousel file in which I want to get index.js and build block.build.js, so my webpack.config.js is: var config = { entry: './index.js', output: { path: __dirname, filename: '...
sonia maklouf's user avatar
122 votes
8 answers
239k views

Webpack how to build production code and how to use it

I am very new to webpack, I found that in production build we can able to reduce the size of overall code. Currently webpack builds around 8MB files and main.js around 5MB. How to reduce the size of ...
Gilson PJ's user avatar
  • 3,529
65 votes
5 answers
45k views

How to minimize the size of webpack's bundle?

I'm writing a web app using react and webpack as my module bundler. My jsx code is really light so far, the size of the entire folder is 25 kb. My bundle.js created from webpack is 2.2 mb though. ...
itaied's user avatar
  • 7,007
60 votes
10 answers
113k views

how to set up an inline svg with webpack

I am wondering how to set up an inline svg with webpack? I am following the react-webpack-cookbook. I have my webpack.config set up correctly with the file loader. However the example shows ...
svnm's user avatar
  • 23.9k

15 30 50 per page
1 2
3
4 5
62