Hi, is it possible to debug with DevTools when using webpack?
Prior to adding webpack I tried debugging my plugin with chrome://inspect and it was working using a debug.json containing,
{
"port": 9345,
"breakOnStart": false
}
Then I added my own webpack setup and it works great but I lost chrome debugging. As a test, I tried this boilerplate plugin project and debugging in chrome still wasn’t available. No targets appear under the “Remote Target #LOCALHOST” header.
Here’s my webpack (not from the boilerplate project referenced above)
const path = require('path')
module.exports = {
// entry: "./src/main.jsx",
entry: "./src/main.ts",
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'main.js',
libraryTarget: "commonjs2"
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
devtool: "none", // prevent webpack from using eval() on my module
// devtool: "source-map", // trying to get chrome://inspect debugging working (works when not using webpack)
// devtool: "cheap-module-source-map & cheap-module-inline-source-map", // trying to get chrome://inspect debugging working (works when not using webpack)
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
]
},
externals: {
uxp: "uxp",
scenegraph: "scenegraph",
// application: "application"
}
}
I’ve tried playing with webpack’s devtool options but it’s not helping. I’m not sure what else to try but having a debugger was definitely more productive. Thanks for any tips!