Skip to content

Commit 16e0254

Browse files
jasonLasterTimer
authored andcommitted
Switch to eval-source-map (facebook#4930)
1 parent c977fbb commit 16e0254

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

config/webpack.config.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module.exports = {
7676
mode: 'development',
7777
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
7878
// See the discussion in https://github.com/facebook/create-react-app/issues/343
79-
devtool: 'cheap-module-source-map',
79+
devtool: 'eval-source-map',
8080
// These are the "entry points" to our application.
8181
// This means they will be the "root" imports that are included in JS bundle.
8282
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

config/webpackDevServer.config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
'use strict';
1010

1111
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
12+
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
1213
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
1314
const ignoredFiles = require('react-dev-utils/ignoredFiles');
1415
const config = require('./webpack.config.dev');
@@ -89,7 +90,10 @@ module.exports = function(proxy, allowedHost) {
8990
},
9091
public: allowedHost,
9192
proxy,
92-
before(app) {
93+
before(app, server) {
94+
// This lets us fetch source contents from webpack for the error overlay
95+
app.use(evalSourceMapMiddleware(server));
96+
9397
// This lets us open files from the runtime error overlay.
9498
app.use(errorOverlayMiddleware());
9599
// This service worker file is effectively a 'no-op' that will reset any

0 commit comments

Comments
 (0)