Closed deco-dev closed 2 years ago
This list is tsc compiled files that gets with--listFiles option.
D:/DI/front-end/node_modules/electron-updater/out/AppAdapter.d.ts
D:/DI/front-end/node_modules/electron-updater/out/DownloadedUpdateHelper.d.ts
D:/DI/front-end/node_modules/electron-updater/out/electronHttpExecutor.d.ts
D:/DI/front-end/node_modules/electron-updater/out/providers/Provider.d.ts
D:/DI/front-end/node_modules/typed-emitter/index.d.ts
D:/DI/front-end/node_modules/electron-updater/out/AppUpdater.d.ts
D:/DI/front-end/node_modules/electron-updater/out/BaseUpdater.d.ts
D:/DI/front-end/node_modules/electron-updater/out/AppImageUpdater.d.ts
D:/DI/front-end/node_modules/electron-updater/out/MacUpdater.d.ts
D:/DI/front-end/node_modules/electron-updater/out/NsisUpdater.d.ts
D:/DI/front-end/node_modules/electron-updater/out/main.d.ts
D:/DI/front-end/desktop/socketClient.ts
This is my build command.
"desktop-tsc": "tsc desktop/main.ts --skipLibCheck --target es5 --outDir build-desktop --esModuleInterop",
I execute npm run desktop-tsc && electron-builder --win
I checked the npm ls --production, it has electron-updater.
+-- electron-updater@5.2.1
| +-- @types/semver@7.3.12
| +-- builder-util-runtime@9.0.3
| | +-- debug@4.3.4
| | | `-- ms@2.1.2 deduped
| | `-- sax@1.2.4
| +-- fs-extra@10.1.0
| | +-- graceful-fs@4.2.6
| | +-- jsonfile@6.1.0
| | | +-- graceful-fs@4.2.6 deduped
| | | `-- universalify@2.0.0 deduped
| | `-- universalify@2.0.0
| +-- js-yaml@4.1.0
| | `-- argparse@2.0.1
| +-- lazy-val@1.0.5
| +-- lodash.escaperegexp@4.1.2
| +-- lodash.isequal@4.5.0
| +-- semver@7.3.7
| | `-- lru-cache@6.0.0
| | `-- yallist@4.0.0
| `-- typed-emitter@2.1.0
| `-- rxjs@7.5.7
| `-- tslib@2.4.0
+-- js-cookie@2.2.1
You shouldn't explicitly exclude "!node_modules"
as that's deliberately blocking the asset from being bundled in the asar. electron-builder should automatically parse your node_modules and only pack the ones that are production dependencies
Did you find a solution? I have a similar problem one with rxjs
The solution I found was to add a postinstall option:
"package": "electron-builder", "postinstall": "electron-builder install-app-deps"
electron-updater: 5.2.1
First I installed electron-updater to dependencies.
And I used electron updater to typescript.
So when I built typescript, There is no error. But I executed the app, the error occurred. So I try to fix some code. This is orignal code. I removed the !node_modules. After that, there is no error.
But I don't want to add node_modules because the app size is increased. This is log that gets with tsc --traceResolution option. As you can see the log, when build time, electron-updater is found. But why can not found the module on runtime?