I am new to capacitor and ionic, and was following the Getting Started at Capacitor website, and run to a problem at point VS Code Extension → Bundle Analysis.
I had created the example project before that (Ionic React, Web and Android), created with VS Code Ionic plugin. I was about to test out the Configuration->Statistics mentioned at that page, when it reported first that I was not having required plugin. (I think it was corepack or source-map-explorer), which I think was installed when I clicked the error message. Not sure though.
However, when trying again I see at Output console:
Building for production with Sourcemaps…
Analyzing Sourcemaps…
And then it stops and shows errors:
Unable to analyze source maps: npx source-map-explorer “c:\test\capacitor\ionic\test_v2\listest\dist/**/*.js” --json --exclude-source-map Failed
And then many lines with
Unable to find a source map. See https://github.com/danvk/source-map-explorer/blob/master/README.md#generating-source-maps
Maybe the reason was that it was not finding the sourcmaps, even though the console said they was being created. Trying to figure out why, I have added these 2 lines to tsconfig.json:
“outDir”: “out”,
“sourceMap”: true
However, the outDir “out” is not created, and it seems sourcemaps neither. If I am right, I should set
“noEmit”: true, .> “noEmit”: false,
That might create the out -directory and possibly then the sourcemaps, but before doing that I thought to ask the community, since the noEmit was set to true by the template that was provided by the Ionic -plugin. So I guess it is needed as that (i.e. to make room for Babel etc).
What am I doing wrong here? Might be a newbie problem, not too familiar with sourcemaps and statistics…