简体   繁体   中英

Bundling module for NODE.JS

ASP.NET MVC 4 has brought amazing tool for bundling multiple stylesheets or javascripts into one like this:

bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                    "~/Content/themes/base/jquery.ui.core.css",
                    "~/Content/themes/base/jquery.ui.datepicker.css",
                    "~/Content/themes/base/jquery.ui.theme.css"));

Does NODE.JS have any modules to fulfil the same task - to bundle client javascript libraries into one? I've seen tools like browserify, uglifier, etc. but these require manual invocation of console commands (or may I have missed something?). Meanwhile, it would be nice to eliminate that excessive step and have middleware that could be easily integrated into express.js application, for instance.

有几种尝试实现此目的的方法,您可以尝试一下,看看哪种方法最适合您: bundle-upbrewer.jsconnect-assetmanager

Not to mention automatic complication of stylus files into a single css file, also usable as express middleware.

Search npm for 'asset' and I'm sure you can find tons of these.

You can also try bl-bundler . It also supports integration with express.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM