{"id":1354,"date":"2023-07-31T15:48:16","date_gmt":"2023-07-31T07:48:16","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=1354"},"modified":"2023-07-31T15:48:16","modified_gmt":"2023-07-31T07:48:16","slug":"h5exe%e6%89%93%e5%8c%85%e5%8e%9f%e7%90%86%e6%96%b9%e6%b3%95%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/1354\/","title":{"rendered":"h5exe\u6253\u5305\u539f\u7406\u65b9\u6cd5\u4ecb\u7ecd"},"content":{"rendered":"

H5exe\u662f\u4e00\u6b3e\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5728Windows\u3001Mac\u548cLinux\u7b49\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002\u5b83\u7684\u539f\u7406\u662f\u901a\u8fc7\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210Electron\u5e94\u7528\u7a0b\u5e8f\uff0c\u5728\u672c\u5730\u8fd0\u884cHTML5\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

H5exe\u7684\u6253\u5305\u6d41\u7a0b\u5927\u81f4\u5982\u4e0b\uff1a<\/p>\n

1. \u5b89\u88c5Node.js\u548cElectron<\/p>\n

H5exe\u662f\u57fa\u4e8eElectron\u7684\uff0c\u6240\u4ee5\u9700\u8981\u5148\u5b89\u88c5Node.js\u548cexe\u6587\u4ef6\u8f6c\u636216\u8fdb\u5236\u5de5\u5177<\/a>Electron\u3002Node.js\u662f\u4e00\u6b3e\u57fa\u4e8eChrome V8\u5f15\u64ce\u7684JavaScript\u8fd0\u884c\u73af\u5883\uff0c\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u7aef\u8fd0\u884cJavaScript\u4ee3\u7801\u3002Electron\u662f\u7531GitHub\u5f00\u53d1\u7684\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u53ef\u4ee5\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u521b\u5efa\u8de8\u5e73\u53f0\u7684\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

2. \u521b\u5efa\u9879\u76ee\u76ee\u5f55<\/p>\n

\u5728\u672c\u5730\u521b\u5efa\u4e00\u4e2a\u9879\u76ee\u76ee\u5f55\uff0c\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u7684\u6240\u6709\u6587\u4ef6\u653e\u5728\u5176\u4e2d\uff0c\u5305\u62ecHTML\u6587\u4ef6\u3001CSS\u6587\u4ef6\u3001JavaScript\u6587\u4ef6\u3001\u56fe\u7247\u7b49\u8d44\u6e90\u6587\u4ef6\u3002<\/p>\n

3. \u5b89\u88c5\u4f9d\u8d56<\/p>\n

\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u6253\u5f00\u547d\u4ee4\u884c\u7a97\u53e3\uff0c\u4f7f\u7528npm\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u5305\uff0c\u5305\u62ecelectron\u3001electron-packager\u7b49\u3002<\/p>\n

4. \u914d\u7f6e\u6253\u5305\u53c2\u6570<\/p>\n

\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2apackage.json\u6587\u4ef6\uff0c\u914d\u7f6e\u6253\u5305\u53c2\u6570\uff0c\u5305\u62ec\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\u3001\u7248\u672c\u53f7\u3001\u56fe\u6807\u3001\u7a97\u53e3\u5927\u5c0f\u7b49\u3002<\/p>\n

5. \u6253\u5305\u5e94\u7528\u7a0b\u5e8f<\/p>\n

\u4f7f\u7528electron-packager\u547d\u4ee4\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\uff0c\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210Electron\u5e94\u7528\u7a0b\u5e8f\u3002\u6253\u5305\u5b8c\u6210\u540e\uff0c\u751f\u6210\u7684\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u5728\u672c\u5730\u8fd0\u884c\uff0c\u5e76\u4e14\u53ef\u4ee5\u5728Windows\u3001Mac\u548cLinux\u7b49\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002<\/p>\n

\u603b\u7684\u6765\u8bf4\uff0cH5exe\u7684\u6253\u5305\u8fc7\u7a0b\u7f51\u9875\u5730\u5740\u6253\u5305exe<\/a>\u6bd4\u8f83\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5b89\u88c5Node.js\u548cElectron\uff0c\u5e76\u914d\u7f6e\u597d\u6253\u5305\u53c2\u6570\uff0c\u5c31\u53ef\u4ee5\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002H5exe\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f<\/p>\n

<\/figure>\n<\/p>\n

\u5feb\u901f\u6253\u5305\u6210\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u4e14\u53ef\u4ee5\u8de8\u5e73\u53f0\u8fd0\u884c\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u4f7f\u7528Electron\u63d0\u4f9b\u7684API\u8bbf\u95ee\u672c\u5730\u6587\u4ef6\u548c\u7cfb\u7edf\u8d44\u6e90\uff0c\u6269\u5c55\u5e94\u7528\u7a0b\u5e8f\u7684\u529f\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

H5exe\u662f\u4e00\u6b3e\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5728Windows\u3001Mac\u548cLinux\u7b49\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002\u5b83\u7684\u539f\u7406\u662f\u901a\u8fc7\u5c06HTML5\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210Electron\u5e94\u7528\u7a0b\u5e8f\uff0c\u5728\u672c\u5730\u8fd0\u884cH<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[3046,12,16,3048,3047],"topic":[],"class_list":["post-1354","post","type-post","status-publish","format-standard","hentry","category-exekf","tag-3046","tag-12","tag-16","tag-3048","tag-3047"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/1354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=1354"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/1354\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=1354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=1354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=1354"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=1354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}