From dccc9cfc363ff04f2eda2f9249a38172ee247952 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 19 Oct 2017 22:47:44 -0700 Subject: [PATCH 1/2] Switch to `nosource-source-map` for dist builds --- make-webpack-config.js | 2 +- webpack-dist-bundle.config.js | 2 +- webpack-dist-standalone.config.js | 2 +- webpack-dist.config.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/make-webpack-config.js b/make-webpack-config.js index c2cc2268..2e81510a 100644 --- a/make-webpack-config.js +++ b/make-webpack-config.js @@ -137,7 +137,7 @@ module.exports = function(rules, options) { } }, - devtool: specialOptions.sourcemaps ? "cheap-module-source-map" : null, + devtool: specialOptions.sourcemaps ? "nosource-source-map" : null, plugins, diff --git a/webpack-dist-bundle.config.js b/webpack-dist-bundle.config.js index 27a26046..48b39be3 100644 --- a/webpack-dist-bundle.config.js +++ b/webpack-dist-bundle.config.js @@ -11,7 +11,7 @@ let rules = [ name: "[name].js" } }, - { loader: "babel-loader" } + { loader: "babel-loader?retainLines=true" } ] } ] diff --git a/webpack-dist-standalone.config.js b/webpack-dist-standalone.config.js index e19f428b..22477a9f 100644 --- a/webpack-dist-standalone.config.js +++ b/webpack-dist-standalone.config.js @@ -11,7 +11,7 @@ let rules = [ name: "[name].js" } }, - { loader: "babel-loader" } + { loader: "babel-loader?retainLines=true" } ] } ] diff --git a/webpack-dist.config.js b/webpack-dist.config.js index 3aa65ed2..391c4a96 100644 --- a/webpack-dist.config.js +++ b/webpack-dist.config.js @@ -13,7 +13,7 @@ let rules = [ name: "[name].js" } }, - { loader: "babel-loader" } + { loader: "babel-loader?retainLines=true" } ] } ] From e51d6c2ed5f127f4055c942baa9c874bf3b56239 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 19 Oct 2017 22:48:34 -0700 Subject: [PATCH 2/2] Stop babelifying dev server twice; use `eval-source-map` --- webpack-hot-dev-server.config.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/webpack-hot-dev-server.config.js b/webpack-hot-dev-server.config.js index e002628f..8d3b591b 100644 --- a/webpack-hot-dev-server.config.js +++ b/webpack-hot-dev-server.config.js @@ -9,13 +9,7 @@ const rules = [ inline: true } }, - { loader: "babel-loader" } - ] - }, - { test: /\.(jsx)(\?.*)?$/, - use: [ - { loader: "react-hot-loader" }, - { loader: "babel-loader" } + { loader: "babel-loader?retainLines=true" } ] }, { test: /\.(css)(\?.*)?$/, @@ -48,7 +42,7 @@ module.exports = require("./make-webpack-config")(rules, { _special: { separateStylesheets: false, }, - devtool: "eval", + devtool: "eval-source-map", entry: { "swagger-ui-bundle": [ "./src/polyfills",