{"id":13451898,"url":"https://github.com/webpack-contrib/babel-minify-webpack-plugin","last_synced_at":"2025-03-23T19:33:10.614Z","repository":{"id":57130057,"uuid":"66643519","full_name":"webpack-contrib/babel-minify-webpack-plugin","owner":"webpack-contrib","description":"[DEPRECATED] Babel Minify Webpack Plugin","archived":true,"fork":false,"pushed_at":"2020-03-16T14:20:07.000Z","size":379,"stargazers_count":488,"open_issues_count":13,"forks_count":37,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-18T21:05:43.493Z","etag":null,"topics":["babel","babel-minify","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webpack-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-26T11:46:23.000Z","updated_at":"2025-03-07T02:36:50.000Z","dependencies_parsed_at":"2022-09-02T11:12:06.337Z","dependency_job_id":null,"html_url":"https://github.com/webpack-contrib/babel-minify-webpack-plugin","commit_stats":null,"previous_names":["webpack-contrib/babili-webpack-plugin"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fbabel-minify-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fbabel-minify-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fbabel-minify-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Fbabel-minify-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webpack-contrib","download_url":"https://codeload.github.com/webpack-contrib/babel-minify-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244547604,"owners_count":20470103,"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":["babel","babel-minify","webpack","webpack-plugin"],"created_at":"2024-07-31T07:01:06.241Z","updated_at":"2025-03-23T19:33:10.301Z","avatar_url":"https://github.com/webpack-contrib.png","language":"JavaScript","readme":"DEPREACTED due to lack of support/bug fixes/ new features, project abandoned, please migrate on https://github.com/webpack-contrib/terser-webpack-plugin\n\n----\n\n[![npm][npm]][npm-url]\n[![deps][deps]][deps-url]\n[![test][test]][test-url]\n[![coverage][cover]][cover-url]\n[![quality][quality]][quality-url]\n[![chat][chat]][chat-url]\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- replace with accurate logo e.g from https://worldvectorlogo.com/ --\u003e\n  \u003ca href=\"https://github.com/webpack/webpack\"\u003e\n    \u003cimg width=\"200\" height=\"200\" vspace=\"\" hspace=\"25\"\n      src=\"https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon.svg\"\u003e\n  \u003c/a\u003e\n  \u003ch1\u003eBabel Minify Webpack Plugin\u003c/h1\u003e\n  \u003cp\u003eA Webpack Plugin for \u003ca href=\"https://github.com/babel/minify\"\u003ebabel-minify\u003c/a\u003e - A babel based minifier\u003cp\u003e\n\u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003eInstall\u003c/h2\u003e\n\n```bash\nnpm install babel-minify-webpack-plugin --save-dev\n```\n\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\n\n```js\n// webpack.config.js\nconst MinifyPlugin = require(\"babel-minify-webpack-plugin\");\nmodule.exports = {\n  entry: //...,\n  output: //...,\n  plugins: [\n    new MinifyPlugin(minifyOpts, pluginOpts)\n  ]\n}\n```\n\n\u003ch2 align=\"center\"\u003eOptions\u003c/h2\u003e\n\n#### minifyOpts\n\n`minifyOpts` are passed on to babel-preset-minify. You can find a list of [all available options](https://github.com/babel/minify/tree/master/packages/babel-preset-minify#options) in the package directory.\n\n`Default: {}`\n\n#### pluginOpts\n\n+ `test`: Test to match files against. Default: `/\\.js($|\\?)/i`\n+ `include`: Files to `include`. Default: `undefined`\n+ `exclude`: Files to `exclude`. Default: `undefined`\n+ `comments`: Preserve Comments. Default: `/^\\**!|@preserve|@license|@cc_on/`, falsy value to remove all comments. Accepts function, object with property test (regex), and values.\n+ `sourceMap`: Configure a sourcemap style. Default: [webpackConfig.devtool](https://webpack.js.org/configuration/devtool/)\n+ `parserOpts`: Configure babel with special parser options.\n+ `babel`: Pass in a custom `babel-core` instead. Default: `require(\"babel-core\")`\n+ `minifyPreset`: Pass in a custom `babel-minify` preset instead. Default: `require(\"babel-preset-minify\")`\n\n\u003ch2 align=\"center\"\u003eWhy\u003c/h2\u003e\n\nYou can also use [babel-loader](https://github.com/babel/babel-loader) for webpack and include `minify` [as a preset](https://github.com/babel/minify#babel-preset) and should be much faster than using this - as babel-minify will operate on smaller file sizes. But then, why does this plugin exist at all? -\n\n+ A webpack loader operates on single files and the minify preset as a webpack loader is going to consider each file to be executed directly in the browser global scope (by default) and will not optimize some things in the toplevel scope. To enable optimizations to take place in the top level scope of the file, use `mangle: { topLevel: true }` in minifyOptions.\n+ When you exclude `node_modules` from being run through the babel-loader, babel-minify optimizations are not applied to the excluded files as it doesn't pass through the minifier.\n+ When you use the babel-loader with webpack, the code generated by webpack for the module system doesn't go through the loader and is not optimized by babel-minify.\n+ A webpack plugin can operate on the entire chunk/bundle output and can optimize the whole bundle and you can see some differences in minified output. But this will be a lot slower as the file size is usually really huge. So there is [another idea](https://github.com/webpack-contrib/babel-minify-webpack-plugin/issues/8) where we can apply some optimizations as a part of the loader and some optimizations in a plugin.\n\n\u003ch2 align=\"center\"\u003eMaintainers\u003c/h2\u003e\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003cimg width=\"150\" height=\"150\"\n        src=\"https://avatars2.githubusercontent.com/u/294474?v=3\u0026s=150\"\u003e\n        \u003c/br\u003e\n        \u003ca href=\"https://github.com/boopathi\"\u003eBoopathi Rajaa\u003c/a\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003cimg width=\"150\" height=\"150\"\n        src=\"https://avatars3.githubusercontent.com/u/166921?v=3\u0026s=150\"\u003e\n        \u003c/br\u003e\n        \u003ca href=\"https://github.com/bebraw\"\u003eJuho Vepsäläinen\u003c/a\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003cimg width=\"150\" height=\"150\"\n        src=\"https://avatars2.githubusercontent.com/u/8420490?v=3\u0026s=150\"\u003e\n        \u003c/br\u003e\n        \u003ca href=\"https://github.com/d3viant0ne\"\u003eJoshua Wiens\u003c/a\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003cimg width=\"150\" height=\"150\"\n        src=\"https://avatars3.githubusercontent.com/u/533616?v=3\u0026s=150\"\u003e\n        \u003c/br\u003e\n        \u003ca href=\"https://github.com/SpaceK33z\"\u003eKees Kluskens\u003c/a\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003cimg width=\"150\" height=\"150\"\n        src=\"https://avatars3.githubusercontent.com/u/3408176?v=3\u0026s=150\"\u003e\n        \u003c/br\u003e\n        \u003ca href=\"https://github.com/TheLarkInn\"\u003eSean Larkin\u003c/a\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003ctbody\u003e\n\u003c/table\u003e\n\n[npm]: https://img.shields.io/npm/v/babel-minify-webpack-plugin.svg\n[npm-url]: https://npmjs.com/package/babel-minify-webpack-plugin\n\n[deps]: https://david-dm.org/webpack-contrib/babel-minify-webpack-plugin.svg\n[deps-url]: https://david-dm.org/webpack-contrib/babel-minify-webpack-plugin\n\n[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg\n[chat-url]: https://gitter.im/webpack/webpack\n\n[test]: https://travis-ci.org/webpack-contrib/babel-minify-webpack-plugin.svg?branch=master\n[test-url]: https://travis-ci.org/webpack-contrib/babel-minify-webpack-plugin\n\n[cover]: https://codecov.io/gh/webpack-contrib/babel-minify-webpack-plugin/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack-contrib/babel-minify-webpack-plugin\n\n[quality]: https://www.bithound.io/github/webpack-contrib/babel-minify-webpack-plugin/badges/score.svg\n[quality-url]: https://www.bithound.io/github/webpack-contrib/babel-minify-webpack-plugin\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Fbabel-minify-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebpack-contrib%2Fbabel-minify-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Fbabel-minify-webpack-plugin/lists"}