Skip to main content

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.

2355 votes
68 answers
3.0m views

Error message "error:0308010C:digital envelope routines::unsupported"

I created the default IntelliJ IDEA React project and got this: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (...
a1cd's user avatar
  • 24.2k
2075 votes
7 answers
310k views

NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack [closed]

I'm trying to summarize my knowledge about the most popular JavaScript package managers, bundlers, and task runners. Please correct me if I'm wrong: npm & bower are package managers. They just ...
VB_'s user avatar
  • 45.5k
655 votes
23 answers
494k views

Error: 'node-sass' version 5.0.0 is incompatible with ^4.0.0

I've created a blank React project, using the command: npx create-react-app on npm v7.0.7 and Node.js v15.0.1 Installed: React v17.0.1, node-sass v5.0.0, Then I tried to import a blank .scss file to ...
JDKot's user avatar
  • 6,713
554 votes
19 answers
1.0m views

Getting Unexpected Token Export

I am trying to run some ES6 code in my project but I am getting an unexpected token export error. export class MyClass { constructor() { console.log("es6"); } }
Jason's user avatar
  • 5,597
519 votes
12 answers
717k views

Webpack build failing with ERR_OSSL_EVP_UNSUPPORTED [duplicate]

I'm having an issue with a Webpack build process that suddenly broke, resulting in the following error... <s> [webpack.Progress] 10% building 0/1 entries 0/0 dependencies 0/0 modules node:...
Ryan Brownell's user avatar
502 votes
12 answers
377k views

Managing jQuery plugin dependency in webpack

I'm using Webpack in my application, in which I create two entry points - bundle.js for all my JavaScript files/codes, and vendors.js for all libraries like jQuery and React. What do I do in order to ...
booleanhunter's user avatar
439 votes
37 answers
648k views

How to Polyfill node core modules in webpack 5

webpack 5 no longer do auto-polyfilling for node core modules. How to fix it please? BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer ...
Saber's user avatar
  • 4,481
437 votes
13 answers
437k views

How to copy static files to build directory with Webpack?

I'm trying to move from Gulp to Webpack. In Gulp I have task which copies all files and folders from /static/ folder to /build/ folder. How to do the same with Webpack? Do I need some plugin?
Vitalii Korsakov's user avatar
436 votes
13 answers
170k views

What does the @ mean inside an import path?

I'm starting a new vue.js project so I used the vue-cli tool to scaffold out a new webpack project (i.e. vue init webpack). As I was walking through the generated files I noticed the following imports ...
Chris Schmitz's user avatar
414 votes
12 answers
561k views

How to add fonts to create-react-app based projects?

I'm using create-react-app and prefer not to eject. It's not clear where fonts imported via @font-face and loaded locally should go. Namely, I'm loading @font-face { font-family: 'Myriad Pro ...
Maxim Veksler's user avatar
413 votes
11 answers
399k views

where is create-react-app webpack config and files?

I create a ReactJS project with the create-react-app package and that worked well, but I cannot find webpack files and configurations. How does react-create-app work with webpack? Where are the ...
Mohammad's user avatar
  • 4,611
401 votes
6 answers
283k views

How do I generate sourcemaps when using babel and webpack?

I want to set up a config to generate sourcemaps. I'm running webpack serve from the command line, which compiles successfully. But I really need sourcemaps. This is my webpack.config.js. var webpack =...
user avatar
401 votes
14 answers
304k views

How to bundle an Angular app for production

What is the best method to bundle Angular (version 2, 4, 6, ...) for production on a live web server. Please include the Angular version within answers so we can track better when it moves to later ...
Pat M's user avatar
  • 6,026
394 votes
18 answers
407k views

Passing environment-dependent variables in webpack

I'm trying to convert an angular app from gulp to webpack. in gulp I use gulp-preprocess to replace some variables in the html page (e.g. database name) depending on the NODE_ENV. What is the best way ...
kpg's user avatar
  • 7,864
366 votes
47 answers
575k views

Field 'browser' doesn't contain a valid alias configuration

I've started using webpack2 (to be precise, v2.3.2) and after re-creating my config I keep running into an issue I can't seem to solve I get (sorry in advance for ugly dump): ERROR in ./src/main.js ...
Matthew Herbst's user avatar

15 30 50 per page
1
2 3 4 5
2856