Skip to main content

All Questions

240 votes
14 answers
388k views

How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?

I am new to the whole nodejs/reactjs world so apologies if my question sounds silly. I am currently playing around with reactabular.js. Whenever I do a npm start it always runs on localhost:8080. How ...
90abyss's user avatar
  • 7,263
140 votes
8 answers
84k views

webpack can't find module if file named jsx

As I write webpack.config.js like this module.exports = { entry: './index.jsx', output: { filename: 'bundle.js' }, module: { loaders: [{ test: /\.jsx?$/, exclude: /...
qiuyuntao's user avatar
  • 2,364
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
109 votes
4 answers
51k views

Webpack-dev-server serves a directory list instead of the app page

I can only see the actual app under /public. The configs in webpack.config.js are below: var path = require('path'); var webpack = require('webpack'); module.exports = { entry: [ 'webpack-...
Jason Lam's user avatar
  • 1,382
81 votes
5 answers
163k views

webpack dev server CORS issue

I am using webpack-dev-server v1.10.1 to boost up my Redux project and I have the options below: contentBase: `http://${config.HOST}:${config.PORT}`, quiet: false, noInfo: true, hot: true, inline: ...
Hao's user avatar
  • 1,544
77 votes
9 answers
20k views

Mocha testing failed due to css in webpack

I'm new to Mocha and I am trying to use it to test a simple React component. The test would pass if the react component doesn't have any CSS styling but throws a syntax error if the tag within the ...
Yi Ren's user avatar
  • 841
57 votes
3 answers
114k views

webpack-dev-server Cannot find module 'webpack'

I'm trying to use webpack-dev-server to run a simple program but I'm getting this error: module.js:471 throw err; ^ Error: Cannot find module 'webpack' at Function.Module....
yonBav's user avatar
  • 1,865
51 votes
3 answers
52k views

Difference between production and development build in ReactJS

Recently I started learning react and I saw a tutorial where they used Webpack to create the production and development builds. But there was no explanation on what the difference between those two ...
Blinxen's user avatar
  • 856
43 votes
2 answers
50k views

Why does my React Component Export not work?

I was just getting into react and trying it out for myself. After hours of configuring webpack just to get a hello world on my screen I thought I could get going now but after trying to render another ...
gerdtf's user avatar
  • 705
40 votes
8 answers
42k views

Webpack-dev-server not bundling even after showing bundle valid message

I've set up a basic react application with webpack but I couldn't get the webpack-dev-server running properly. I've installed webpack-dev-server globally and tried running the command sudo webpack-...
Karthik Rana's user avatar
  • 1,301
37 votes
2 answers
37k views

How to configure webpack dev server with react router dom v4?

This is the code of my webpack configuration: const compiler = webpack({ entry: ['whatwg-fetch', path.resolve(__dirname, 'js', 'app.js')], module: { loaders: [ { exclude: /...
gpbaculio's user avatar
  • 5,910
35 votes
2 answers
19k views

Mocha tests don't run with Webpack and mocha-loader

Background I am porting some npm scripts to Webpack loaders to better learn how Webpack works and I’ve got everything working except for my Mocha tests: I have one failing test, but it is not showing ...
user avatar
32 votes
6 answers
72k views

"Invalid Host Header" in When running React App

I am having one simple project of React JS and I am deploying into OSE. Also I am using below dependencies in my project. "webpack": "^2.2.0", "webpack-dev-server": "^1.14.1", "react": "^15.5.4", ...
Bharat Sewani's user avatar
30 votes
4 answers
92k views

Content not from webpack is served from /foo

I just can't start this server, I read the webpack-dev-server docs. devServer: { contentBase: path.join(__dirname, "dist"), compress: true, port: 9000 } The sample code looks simple,but I just ...
McGrady's user avatar
  • 11.3k
30 votes
1 answer
7k views

what's the difference between webpack:// and webpack-internal://

I'm writing a webpack-react-typescript kit, and I've found that the source-map can't direct to the source code. It directs to the webpack-internal://src/App.tsx file, this file has some webpack ...
mrkou47's user avatar
  • 351

15 30 50 per page
1
2 3 4 5
48