How to use a node.js library in html?

后端 未结 1 565
清歌不尽
清歌不尽 2021-01-16 12:40

I install fancybox dependency via :

npm install fancybox

I\'m attempting to use the fancybox css within a html page :

<         


        
相关标签:
1条回答
  • 2021-01-16 12:59

    The way to do this is to use a build tool such as webpack. You use npm to install your libraries into the node_modules/ subdirectory, require them within your javascript files and use webpack to produce a single bundle .js file that contains everything.

    I'd start here: http://webpack.github.io/docs/what-is-webpack.html

    0 讨论(0)
提交回复
热议问题