我使用电子创建桌面应用程序,并尝试了电子打包器。但是 electron-packager 不会打包名称以“@”开头的节点模块(例如:@turf、@mapbox)
在开发文件夹的 node_modules 文件夹中,我可以找到“@turf”和“@mapbox”。
但是跑完之后
>electron-packager . MaplatEditor --platform=darwin --arch=x64 --electron-version=1.7.9
创建的包从不包含“@turf”和“@mapbox”。而且,它的依赖模块也不包括在内。
我的 package.json 包含“@turf”,所以它没有设置错误。
{
"name": "MaplatEditor",
"version": "1.0.0",
"description": "",
"main": "lib/main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@turf/turf": "^4.6.1",
"argv": "0.0.2",
"async": "^2.5.0",
"child_process": "^1.0.2",
"electron-json-storage": "^3.2.0",
"file-url": "^2.0.2",
"fs-extra": "^3.0.1",
"imagemagick": "^0.1.3",
"mapshaper": "^0.4.31",
"path": "^0.12.7",
"wellknown": "^0.5.0"
}
}
如何将此类 @-started 模块打包到应用程序包中?