I'm following the guide bellow as suggested by vscode as my extension is getting apparently large: https://code.visualstudio.com/api/working-with-extensions/bundling-extension
I followed the instructions verbatim, and copied the webpack.config.js exactly as it is on that page. Running the npm run webpack
as instructed results in the following errors:
> npm run webpack
> vsc-octave-debugger@0.3.18 webpack /Users/paulo/dev/javascript/vscOctaveDebugger
> webpack --mode development
Hash: 8845934a16e1bf0af4ce
Version: webpack 4.41.5
Time: 1809ms
Built at: 02/02/2020 5:36:33 PM
Asset Size Chunks Chunk Names
extension.js 11.6 KiB main [emitted] main
extension.js.map 9.53 KiB main [emitted] [dev] main
Entrypoint main = extension.js extension.js.map
[./src/Constants.ts] 1.06 KiB {main} [built]
[./src/extension.ts] 2.33 KiB {main} [built] [2 errors]
[vscode] external "vscode" 42 bytes {main} [built]
ERROR in /Users/paulo/dev/javascript/vscOctaveDebugger/src/OctaveDebugger.ts
[tsl] ERROR in /Users/paulo/dev/javascript/vscOctaveDebugger/src/OctaveDebugger.ts(14,8)
TS2307: Cannot find module 'vscode-debugadapter'.
ERROR in /Users/paulo/dev/javascript/vscOctaveDebugger/src/OctaveDebugger.ts
[tsl] ERROR in /Users/paulo/dev/javascript/vscOctaveDebugger/src/OctaveDebugger.ts(16,31)
TS2307: Cannot find module 'vscode-debugprotocol'.
(many similar errors...)
ERROR in /Users/paulo/dev/javascript/vscOctaveDebugger/src/Utils/fsutils.ts
[tsl] ERROR in /Users/paulo/dev/javascript/vscOctaveDebugger/src/Utils/fsutils.ts(2,31)
TS2307: Cannot find module 'vscode-debugprotocol'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! vsc-octave-debugger@0.3.18 webpack: `webpack --mode development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the vsc-octave-debugger@0.3.18 webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/paulo/.npm/_logs/2020-02-02T08_47_30_676Z-debug.log
All these modules actually exist in the node_modules
and I did run npm i
before. The extension works fine without webpack. Any ideas on how to fix this, or at least understand why webpack can't find the modules? Thanks!
I've created a patch that can be used with the example on that page to reproduce the issue: https://pastebin.com/peqvJ1Wt