chrome-extension-typescript-starter icon indicating copy to clipboard operation
chrome-extension-typescript-starter copied to clipboard

Awesome project, Im just not being able to debug from typescript on vscode

Open Ortega-Dan opened this issue 5 years ago • 0 comments

Sorry it is possibly lack of knowledge from my end ...

but I was able to port a chrome extension I had ... everything is working fine, but Im not able to debug from vscode ...

I know I need the sourcemaps for it so I change the tsconfig to

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "noImplicitAny": false,
        "sourceMap": true, // <--------------- here the change
        "rootDir": "src",
        "outDir": "dist/js",
        "noEmitOnError": true,
        "typeRoots": [
            "node_modules/@types"
        ]
    }
}

but if I compile it like that (with tsc) it gives me the runtime error: Uncaught ReferenceError: exports is not defined ...

I know that can be related to the module in the tsconfig.json ... but if i change it from

    "module": "commonjs",

to

    "module": "umd",   // or "amd"

it then doesnt find a chain of dependencies ... starting from "moment" ...


and if (instead of all that) I do "npm run build" it doesnt create the sourceMaps in order to debug from typescript ...

I will appreciate so much your help ....

Ortega-Dan avatar May 15 '20 17:05 Ortega-Dan