gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 00:37:32 26 4
gpt4 key购买 nike

我想知道是否有工具或方法可以开发 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com