Skip to content

Commit

Permalink
fix(Debug): add support for breakpoints via sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Garifullin committed Apr 24, 2021
1 parent 206136d commit ce62acf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
7 changes: 1 addition & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"request": "launch",
"name": "Debug DQt",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/qode",
"runtimeArgs": ["--inspect", "--trace-warnings"],
"runtimeArgs": ["--nolazy", "--inspect", "--trace-warnings"],
"skipFiles": [
"<node_internals>/**"
],
Expand All @@ -18,11 +18,6 @@
"${workspaceFolder}/src/**/*.ts"
],
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///./~/*": "${workspaceRoot}/node_modules/*",
"webpack:///./*": "${workspaceRoot}/*",
"webpack:///*": "*"
},
"console": "internalConsole"
}
]
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"esModuleInterop": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"typeRoots": ["./src/types/"]
},
"exclude": ["node_modules/**/*.ts"]
Expand Down
40 changes: 24 additions & 16 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { readdirSync } = fs;
let __BUILDNUM__;

try {
__BUILDNUM__ = childProcess.execSync('git rev-list HEAD --count').toString()
__BUILDNUM__ = childProcess.execSync('git rev-list HEAD --count').toString();
} catch (e) {
__BUILDNUM__ = 0;
}
Expand All @@ -23,15 +23,15 @@ module.exports = (_env, argv) => {
const isDev = argv.mode !== 'production';
let themes = {};

readdirSync('./src/themes')
.forEach((value) => {
themes = {
...themes,
[value.replace('.scss', '')]: `./src/themes/${value}`,
};
});
readdirSync('./src/themes').forEach((value) => {
themes = {
...themes,
[value.replace('.scss', '')]: `./src/themes/${value}`,
};
});

return {
devtool: 'eval-cheap-module-source-map',
mode: isDev ? 'development' : 'production',
entry: {
'index.js': './src',
Expand All @@ -40,11 +40,13 @@ module.exports = (_env, argv) => {
},
optimization: {
minimize: !isDev,
minimizer: [new TerserPlugin({
terserOptions: {
keep_classnames: true,
},
})],
minimizer: [
new TerserPlugin({
terserOptions: {
keep_classnames: true,
},
}),
],
},
target: 'node',
node: {
Expand Down Expand Up @@ -130,10 +132,16 @@ module.exports = (_env, argv) => {
{ from: 'node_modules/source-sans-pro/TTF/*', to: 'assets/fonts/[name].[ext]' },
{ from: 'node_modules/ffmpeg-static/ffmpeg', noErrorOnMissing: true },
{ from: 'node_modules/ffmpeg-static/ffmpeg.exe', noErrorOnMissing: true },
{ from: `node_modules/ffplay-static/bin/${platform()}/${arch()}/ffplay`, noErrorOnMissing: true },
{ from: `node_modules/ffplay-static/bin/${platform()}/${arch()}/ffplay.exe`, noErrorOnMissing: true },
{
from: `node_modules/ffplay-static/bin/${platform()}/${arch()}/ffplay`,
noErrorOnMissing: true,
},
{
from: `node_modules/ffplay-static/bin/${platform()}/${arch()}/ffplay.exe`,
noErrorOnMissing: true,
},
],
}),
],
}
};
};

0 comments on commit ce62acf

Please sign in to comment.