Как упаковать исходный код vscode в приложение - PullRequest
0 голосов
/ 18 июня 2020

Действия по воспроизведению ошибки:

$ git clone https://github.com/microsoft/vscode.git
$ yarn //building and installing all dependencies
$ yarn watchd //building vscode
$ electron-packager . demo --platform=win32 --arch=x64 --icon=logo.ico --out=./out  --app-version=0.0.1 --overwrite --ignore=node_modules // package app

Сообщение об ошибке: Теперь, когда я пытаюсь открыть demo.exe, появляется сообщение об ошибке:

[Window Title]
Error

[Main Instruction]
A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
Error: Cannot find module 'minimist'
 'C:\Users\smcro\AppData\Local\Programs\Microsoft VS Code\resources\app\out\main'
    at Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
    at Function.Module._resolveFilename (C:\Users\smcro\AppData\Local\Programs\Microsoft VS Code\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.Module._load (internal/modules/cjs/loader.js:528:25)
    at Object.<anonymous> (C:\Users\smcro\AppData\Local\Programs\Microsoft VS Code\resources\electron.asar\browser\init.js:189:8)
    at Object.<anonymous> (C:\Users\smcro\AppData\Local\Programs\Microsoft VS Code\resources\electron.asar\browser\init.js:191:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)

[OK]

, но я позволил зависимостям компилироваться вместе, это успешно. щелкнув demo.exe, покажите vscode. Программа vs исполнительная имеет 800 м.

Проблема, с которой я столкнулся сейчас, заключается в том, как упаковать Vscode в небольшой том без папки node_modules.

когда я использую эту команду, отображается сообщение об ошибке yarn run gulp vscode-win32-x64-min

[18:00:58] 'vscode-win32-x64-min' errored after 10 min
[18:00:58] Error: end of central directory record signature not found
    at G:\workspace\vscode\node_modules\gulp-vinyl-zip\node_modules\yauzl\index.js:187:14
    at G:\workspace\vscode\node_modules\gulp-vinyl-zip\node_modules\yauzl\index.js:631:5
    at G:\workspace\vscode\node_modules\gulp-vinyl-zip\node_modules\fd-slicer\index.js:32:7
    at FSReqWrap.wrapper [as oncomplete] (fs.js:467:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.


...