{"id":13429976,"url":"https://github.com/madskristensen/BundlerMinifier","last_synced_at":"2025-03-16T04:31:32.507Z","repository":{"id":33244801,"uuid":"36889151","full_name":"madskristensen/BundlerMinifier","owner":"madskristensen","description":"Visual Studio extension","archived":false,"fork":false,"pushed_at":"2024-05-03T10:21:02.000Z","size":2020,"stargazers_count":622,"open_issues_count":307,"forks_count":175,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-02-27T20:59:59.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madskristensen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"madskristensen"}},"created_at":"2015-06-04T18:52:19.000Z","updated_at":"2025-02-26T16:16:17.000Z","dependencies_parsed_at":"2022-07-08T12:48:59.534Z","dependency_job_id":"dfeb46b5-fcaf-4a55-ac3c-aadc346c01b2","html_url":"https://github.com/madskristensen/BundlerMinifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskristensen%2FBundlerMinifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskristensen%2FBundlerMinifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskristensen%2FBundlerMinifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskristensen%2FBundlerMinifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madskristensen","download_url":"https://codeload.github.com/madskristensen/BundlerMinifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241077331,"owners_count":19905726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:00:48.740Z","updated_at":"2025-03-16T04:31:32.020Z","avatar_url":"https://github.com/madskristensen.png","language":"C#","funding_links":["https://github.com/sponsors/madskristensen"],"categories":["Frameworks, Libraries and Tools","others","C# #","框架, 库和工具","Bundling and Minification"],"sub_categories":["Bundling and Minification","css, js帮助工具"],"readme":"# Bundler and Minifier\n\nA Visual Studio extension that let's you configure bundling and\nminification of JS, CSS and HTML files.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/ktn1qy982qsprwb5?svg=true)](https://ci.appveyor.com/project/madskristensen/bundlerminifier)\n[![NuGet](https://img.shields.io/nuget/v/BuildBundlerMinifier.svg?style=flat)](https://www.nuget.org/packages/BuildBundlerMinifier/) \n\nDownload the extension at the\n[VS Gallery](https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40)\nor get the\n[nightly build](http://vsixgallery.com/extension/a0ae318b-4f07-4f71-93cb-f21d3f03c6d3/)\n\n---------------------------------------\n\nSee the\n[changelog](CHANGELOG.md)\nfor changes and roadmap and the \n[wiki](https://github.com/madskristensen/BundlerMinifier/wiki)\nfor more details.\n\n## Features\n\n- Bundles CSS, JavaScript or HTML files into a single output file\n- Saving a source file triggers re-bundling automatically\n- Support for globbing patterns\n- MSBuild support for CI scenarios supported\n- Minify individual or bundled CSS, JavaScript and HTML files\n- Minification options for each language is customizable\n- Shows a watermark when opening a generated file\n- Task Runner Explorer integration\n- Command line support\n- Shortcut to update all bundles in solution\n- Suppress output file generation\n- Convert to Gulp\n\n### A note about encoding\nAll files without a BOM (Byte Order Mark) is treated as UTF-8. If you\nsee strange characters in the output bundle files, you may want to consider\nsaving the input files as UTF-8 or an encoding that lets you specify a BOM.\n\n### Bundling\n\nSelect 2 or more of the same type of files in Solution Explorer\nto create a bundle.   \n\n![Create bundle](art/contextmenu-createbundle.png)\n\nAny edits being made to the source files will instantly produce\nupdated bundle file output.\n\nThe bundle configuration is stored in a file called `bundleconfig.json`\nwhich gets added to the root of the project.\n\n### Minification\n\nMinify any JS, CSS or HTML file by right-clicking it in Solution\nExplorer. That will create a _[filename].min.[ext]_ and nest\nit under the original file.\n\n![Minify file](art/contextmenu-minify.png)\n\nWhen the original file is modified, a new min file is produced\ninstantly.\n\n### Bundle on build / CI support\nIn ASP.NET MVC and WebForms projects you can enable bundling and\nminification as part of the build step. Simply right-click the\n`bundleconfig.json` file to enable it.\n\n![Bundle on build](art/contextmenu-bundleonbuild.png)\n\nClicking the menu item will prompt you with information about what will\nhappen if you click the OK button.\n\n![Bundle on build prompt](art/prompt-compileonsave.png)\n\nA NuGet package will be installed into the `packages` folder without adding\nany files to the project itself. That NuGet package contains an MSBuild\ntask that will run the exact same compilers on the `bundleconfig.json`\nfile in the root of the project.\n\nFor ASP.NET Core projects, see the [wiki](https://github.com/madskristensen/BundlerMinifier/wiki)\n\n### Update all bundles\n\nYou can run the bundler on all `bundleconfig.json` files\nin the solution by using the keyboard shortcut `Shift+Alt+i`\nor by using the button on the top level Build menu.\n\n![Update all bundles](art/build-menu.png)\n\n### Source maps\n\nSource maps are supported for JavaScript minification only at this time.\n\nA `.map` file is produced next to the `.min.js` file automatically,\nbut if you manually delete the `.map` file, a new one will not be\ncreated on subsequent minifications.\n\nTo enable source maps, add this property to the `bundleconfig.json`\nfile:\n\n```json\n\"sourceMap\": true\n```\n\n### Task Runner Explorer\nGet a quick overview of the files you've specified or execute a bundle\ndirectly in Task Runner Explorer.\n\n![Task Runner Explorer](art/task-runner-explorer.png)\n\nYou can even set bindings so that bundling/minification happens automatically\nduring certain Visual Studio events, such as BeforeBuild and Project Open.\n\n![Task Runner Bindings](art/task-runner-bindings.png)\n\n### Suppress output file generation\nThere are cases when you don't want the extension to listen for file\nchanges and generate bundled and minified output. That could be if you\nwant to use Gulp to use `bundleconfig.json` or server-side code instead. In\nthose cases it will still be helpful to have the `bundleconfig.json` file\nwith all the Visual Studio tooling around it, but let other tools handle\nthe bundling and minification process.\n\nTo suppress the output, remove the checkbox located in the right-click\nmenu of `bundleconfig.json`.\n\n![Suppress output](art/context-menu-suppress-output.png)\n\n### Convert to Gulp\nThis feature makes it easy to start using Gulp based on what's already\nconfigured in `bundleconfig.json`. It will create `gulpfile.js` and\n`package.json` if they don't already exist and then install the needed\nnode modules using npm.\n\nThe `gulpfile.js` will consume `bundleconfig.json` to get the input and\noutput file paths, but will use regular gulp plugins to do all the\nbundling and minification. You can modify it to use other plugins without\nlosing its ability to read the `bundleconfig.json`.\n\nRead more about this and see code samples on the \n[wiki](https://github.com/madskristensen/BundlerMinifier/wiki).\n\n### bundleconfig.json\n\nThe extension adds a `bundleconfig.json` file at the root of the\nproject which is used to configure all bundling.\n\nHere's an example of what that file looks like:\n\n```js\n[\n  {\n    \"outputFileName\": \"output/bundle.css\",\n    \"inputFiles\": [\n      \"css/lib/**/*.css\", // globbing patterns are supported\n      \"css/input/site.css\"\n    ],\n    \"minify\": {\n        \"enabled\": true,\n        \"commentMode\": \"all\"\n    }\n  },\n  {\n    \"outputFileName\": \"output/all.js\",\n    \"inputFiles\": [\n      \"js/*.js\",\n      \"!js/ignore.js\" // start with a ! to exclude files\n    ]\n  },\n  {\n    \"outputFileName\": \"output/app.js\",\n    \"inputFiles\": [\n      \"input/main.js\",\n      \"input/core/*.js\" // all .js files in input/core/\n    ]\n  }\n]\n```\n\n## Contribute\nCheck out the [contribution guidelines](.github/CONTRIBUTING.md)\nif you want to contribute to this project.\n\nFor cloning and building this project yourself, make sure\nto install the\n[Extensibility Tools](https://visualstudiogallery.msdn.microsoft.com/ab39a092-1343-46e2-b0f1-6a3f91155aa6)\nextension for Visual Studio which enables some features\nused by this project.\n\n## License\n[Apache 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadskristensen%2FBundlerMinifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadskristensen%2FBundlerMinifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadskristensen%2FBundlerMinifier/lists"}