2017-03-04 16 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它不起作用。

回答

相關問題