2017-03-04 39 views
0

js文件我用我的app.js在浏览器browserify:捆绑node_modules的浏览器,并保持“app.js”,即使用NPM节点模块<code>greetings</code>不变

enter image description here

我的指数。 HTML是这样的:

enter image description here

我知道该文件app.js的源代码现已嵌入到文件bundle.js英寸

我现在有我的生产代码包含app.js和包含这样的节点模块附加libary要求:

enter image description here

这意味着客户端获取app.js文件和bundle.js文件我现在可以使用节点模块从我app.js这样的:

enter image description here

基本上我只想要一个bundle.js作为我的app.js的库文件并包含节点模块,以便可以将它们包含在浏览器端JavaScript中。

我也厌倦了使用客户端文件和模块加载器。 require.js加载node_modules,但根据this thread它不起作用。

回答

相关问题