簡體   English   中英

如何為express.js應用程序設置webpack,而不是應用程序?

[英]How to setup webpack for express.js application, not react app?

我需要使用Express.js,jade和less創建應用程序,並希望在webpack中捆綁應用程序。 整個互聯網上充滿了關於設置webpack的文章反應,但沒有人關於設置它與模塊化的JavaScript的通常快遞應用程序。

還沒有一篇關於如何從.less文件制作common.css的文章

請幫幫我!

  • https://github.com/webpack/less-loader
  • https://github.com/webpack/jade-loader

     require("jade!./template.jade"); // => uses the "jade-loader" (that is installed from npm to "node_modules") // to transform the file "template.jade" require("!style!css!less!bootstrap/less/bootstrap.less"); // => the file "bootstrap.less" in the folder "less" in the "bootstrap" // module (that is installed from github to "node_modules") is // transformed by the "less-loader". The result is transformed by the // "css-loader" and then by the "style-loader". 

單獨的裝載機!

請查看webpack文檔中的配置API,以獲取有關如何設置捆綁過程的示例。 這只是定義您的入口點和目的地的問題。

如果您正在尋找自動刷新,請查看webpack dev服務器API。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM