All Questions
714
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 ...
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: /...
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 ...
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-...
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: ...
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 ...
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....
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 ...
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 ...
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-...
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: /...
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 ...
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",
...
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 ...
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 ...