Skip to content

Commit

Permalink
Add stack-source-map again but only for Chrome.
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoda committed May 17, 2016
1 parent 464a463 commit d1aad7f
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 13 deletions.
22 changes: 11 additions & 11 deletions dist/manager.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/manager.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions dist/server/error_enhancements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

var isChrome = function isChrome() {
return navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
};

// This only works with Chrome (AKA V8).
// So, using this on other browsers cause problems.
// But this provides a lot of value when debugging bundled code.
if (isChrome()) {
require('stack-source-map/register');
}
2 changes: 1 addition & 1 deletion dist/server/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var config = {
devtool: '#cheap-module-eval-source-map',
entry: {
manager: [managerEntry],
preview: ['webpack-hot-middleware/client']
preview: [_path2.default.resolve(__dirname, './error_enhancements'), 'webpack-hot-middleware/client']

This comment has been minimized.

Copy link
@einsty

einsty Jun 7, 2016

@arunoda ... I found that I had to change this path to include './node_modules/' before the 'webpack-hot-middleware/client' in order for my project to build. Does that make sense to you or should there be a more elegant way to address that? I was getting an error stating that the webpack-hot-middleware/client' couldn't be found otherwise.

},
output: {
path: _path2.default.join(__dirname, 'dist'),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"keycode": "^2.1.1",
"webpack-dev-middleware": "^1.6.0",
"webpack-hot-middleware": "^2.10.0",
"stack-source-map": "^1.0.5",
"babel-core": "^6.3.15",
"babel-loader": "^6.2.0",
"babel-polyfill": "^6.3.15",
Expand Down
10 changes: 10 additions & 0 deletions src/server/error_enhancements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var isChrome = function() {
return navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
};

// This only works with Chrome (AKA V8).
// So, using this on other browsers cause problems.
// But this provides a lot of value when debugging bundled code.
if(isChrome()) {
require('stack-source-map/register');
}
1 change: 1 addition & 0 deletions src/server/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const config = {
managerEntry,
],
preview: [
path.resolve(__dirname, './error_enhancements'),
'webpack-hot-middleware/client',
],
},
Expand Down

0 comments on commit d1aad7f

Please sign in to comment.