如何为express.js应用程序设置webpack,而不是应用程序?

Vad*_*dim 5 javascript less express webpack pug

我需要使用Express.js,jade和less创建应用程序,并希望在webpack中捆绑应用程序.整个互联网上充满了关于设置webpack的文章反应,但没有人关于设置它与模块化的JavaScript的通常快递应用程序.

还没有一篇关于如何从.less文件制作common.css的文章

请帮帮我!

tel*_*lls 1

  • 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".  
    
    Run Code Online (Sandbox Code Playgroud)

单独的装载机!

查看 webpack 文档中的配置 API,获取有关如何设置捆绑过程的示例。这只是定义您的入口点和目的地的问题。

如果您正在寻找自动刷新功能,请查看 webpack 开发服务器 API。