javascript - 将 JS 应用程序部署到浏览器和 nw.js 或 Atom Electron?

标签 javascript node.js electron nw.js

我想知道是否有工具或方法可以开发 javascript 应用程序并将其部署到浏览器 javascript 或使用 nwjs 或 Atom Electron 的 native 应用程序。
当然,它必须使用浏览器兼容的功能,而不是 Node 的 native 功能。
我想这只是如何捆绑文件的问题,但也许已经有一个工具可以做到这一点。

最佳答案

尝试使用browserify ,真的很酷。

browserify is a tool for compiling node-flavored commonjs modules for the browser.

You can use browserify to organize your code and use third-party libraries even if you don't use node itself in any other capacity except for bundling and installing packages with npm.

The module system that browserify uses is the same as node, so packages published to npm that were originally intended for use in node but not browsers will work just fine in the browser too.

Increasingly, people are publishing modules to npm which are intentionally designed to work in both node and in the browser using browserify and many packages on npm are intended for use in just the browser. npm is for all javascript, front or backend alike

https://github.com/substack/browserify-handbook#introduction

关于javascript - 将 JS 应用程序部署到浏览器和 nw.js 或 Atom Electron?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38330967/

相关文章:

javascript - 延迟循环nodejs的每次迭代

node.js - Docker - 从主机访问容器内的文件

javascript - 使用新的 accessToken 更新应用程序中的 accessToken 的最佳方法是什么?

javascript - Handlebars.js 原始帮助程序

javascript - ShieldUI Grid - 仅在插入时显示下拉列表

javascript - 有没有办法将电子表格信息链接到我的 HTML 文件中?

javascript - 将一些初始数据传递到新窗口的正确方法是什么?

php - jquery上传完成后重定向到新页面

node.js - 在sqlite中保留换行符

javascript - 从渲染器调用主进程中的函数