Skip to content

Commit

Permalink
dropped source-map-support and "fixed" stack trace offset
Browse files Browse the repository at this point in the history
the offset in stack trace appears to be caused by a bug in node.js which has been around for almost 4 years where it doesn't account for the "wrapper" that webpack introduces on the first line.
The "fix" is to force a max line width which means the positions for everything after the first line, which is everything of interest, will be ok
  • Loading branch information
TanninOne committed Mar 6, 2019
1 parent cf5c41f commit 45035e8
Show file tree
Hide file tree
Showing 9 changed files with 392 additions and 263 deletions.
1 change: 0 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"semvish": "^1.1.0",
"shortid": "^2.2.13",
"simple-vdf": "^1.1.1",
"source-map-support": "^0.5.9",
"string-template": "^1.0.0",
"tmp": "^0.0.33",
"turbowalk": "Nexus-Mods/node-turbowalk",
Expand Down
8 changes: 8 additions & 0 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3363,6 +3363,14 @@ simple-vdf@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/simple-vdf/-/simple-vdf-1.1.1.tgz#07e2c4dec06cf614ed6f4211b18cce123c93fca9"

source-map-support@^0.5.10:
version "0.5.10"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c"
integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"

source-map-support@^0.5.9:
version "0.5.9"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f"
Expand Down
2 changes: 1 addition & 1 deletion electron-builder-advanced.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme,test,__tests__,tests,powered-test,example,examples,*.d.ts}",
"!**/node_modules/.bin${/*}",
"!**/*.{o,hprof,orig,pyc,pyo,rbc}",
"!**/node_modules/**/*.js.map",
"!**/*.js.map",
"!**/._*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,__pycache__,thumbs.db,.gitignore,.gitattributes,.editorconfig,.flowconfig,.yarn-metadata.json,.idea,appveyor.yml,.travis.yml,circle.yml,npm-debug.log,.nyc_output,yarn.lock,.yarn-integrity}",
"!**/*.{pdb,lib,VC.db,exp,gypi,d.ts}",
Expand Down
2 changes: 1 addition & 1 deletion electron-builder-oneclick.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme,test,__tests__,tests,powered-test,example,examples,*.d.ts}",
"!**/node_modules/.bin${/*}",
"!**/*.{o,hprof,orig,pyc,pyo,rbc}",
"!**/node_modules/**/*.js.map",
"!**/*.js.map",
"!**/._*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,__pycache__,thumbs.db,.gitignore,.gitattributes,.editorconfig,.flowconfig,.yarn-metadata.json,.idea,appveyor.yml,.travis.yml,circle.yml,npm-debug.log,.nyc_output,yarn.lock,.yarn-integrity}",
"!**/*.{pdb,lib,VC.db,exp,gypi,d.ts}",
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "https://github.com/Nexus-Mods/Vortex"
},
"vortex": {
"electron": "2.0.16"
"electron": "2.0.17"
},
"scripts": {
"_assets_out": "node InstallAssets.js out",
Expand All @@ -20,6 +20,7 @@
"build_api": "cd api && yarn run build",
"build_rest": "yarn run _assets_out && yarn run build_api && yarn run subprojects",
"build_dist": "webpack --config webpack.main.config.js && webpack --config webpack.renderer.config.js",
"extract_sourcemaps": "copyfiles -u 1 app/**/*.js.map sourcemaps",
"package": "electron-builder --config electron-builder-oneclick.json && electron-builder --config electron-builder-advanced.json",
"predist": "yarn run --non-interactive build_api && yarn run --non-interactive _install_app && yarn run --non-interactive subprojects_app && yarn run --non-interactive _assets_app",
"dist": "yarn run build_dist && yarn run package",
Expand Down Expand Up @@ -127,7 +128,7 @@
"copyfiles": "^2.0.0",
"cross-env": "^5.1.0",
"devtron": "^1.4.0",
"electron": "2.0.16",
"electron": "2.0.17",
"electron-builder": "20.15.0",
"electron-devtools-installer": "^2.2.1",
"electron-download-tf": "^4.3.4",
Expand All @@ -146,15 +147,15 @@
"redux-devtools-log-monitor": "^1.4.0",
"redux-freeze": "^0.1.5",
"rm-local-modules": "^0.0.2",
"rollup-plugin-typescript": "^0.8.1",
"terser-webpack-plugin": "^1.2.3",
"ts-jest": "^23.0.1",
"ts-loader": "^5.3.0",
"ts-loader": "^5.3.3",
"tslint": "^5.8.0",
"tslint-eslint-rules": "^5.3.1",
"tslint-react": "^3.2.0",
"typescript": "^2.9.2",
"webpack": "^4.25.1",
"webpack-cli": "^3.1.2",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3",
"webpack-node-externals": "^1.7.2"
},
"dependencies": {
Expand Down Expand Up @@ -231,7 +232,6 @@
"semvish": "^1.1.0",
"shortid": "^2.2.13",
"simple-vdf": "^1.1.1",
"source-map-support": "^0.5.9",
"string-template": "^1.0.0",
"tmp": "^0.0.33",
"turbowalk": "Nexus-Mods/node-turbowalk",
Expand Down
3 changes: 0 additions & 3 deletions src/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ console.error = (...args) => {
window.addEventListener('error', earlyErrHandler);
window.addEventListener('unhandledrejection', earlyErrHandler);

import * as sourceMapSupport from 'source-map-support';
sourceMapSupport.install();

import requireRemap from './util/requireRemap';
requireRemap();

Expand Down
11 changes: 7 additions & 4 deletions webpack.main.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin');

const mode = 'production';

Expand Down Expand Up @@ -31,12 +31,15 @@ module.exports = {
devtool: 'source-map',
optimization: {
minimizer: [
new UglifyJSPlugin({
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true,
uglifyOptions: {
compress: true,
terserOptions: {
compress: {},
output: {
max_line_len: 256,
},
mangle: false,
keep_fnames: true, // required atm, name mangling breaks extensions
}
Expand Down
11 changes: 7 additions & 4 deletions webpack.renderer.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var webpack = require('webpack');
var nodeExternals = require('webpack-node-externals');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')

const mode = 'production';

Expand Down Expand Up @@ -37,12 +37,15 @@ module.exports = {
],
optimization: {
minimizer: [
new UglifyJSPlugin({
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true,
uglifyOptions: {
compress: true,
terserOptions: {
compress: {},
output: {
max_line_len: 256,
},
mangle: false,
keep_fnames: true, // required atm, name mangling breaks extensions
}
Expand Down
Loading

0 comments on commit 45035e8

Please sign in to comment.