{"name":"@putout/plugin-webpack","version":"4.0.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin helps with migration to latest webpack","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-webpack#readme","main":"lib/index.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","webpack"],"devDependencies":{"@putout/eslint-flat":"^3.0.0","@putout/test":"^13.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^26.0.0","madrun":"^11.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=40"},"license":"MIT","engines":{"node":">=20"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-webpack@4.0.0","gitHead":"e0340cee82fc9cef631e53520bd2e294c2473a73","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"22.14.0","_npmVersion":"11.1.0","dist":{"integrity":"sha512-GG9AhIxEE9du8lrL8LXvLSsk7jpWgs/Uib2XrIdZvkD1GdrdP7scoNvqFpjXM2vBGn5MV/SEJXts5dy3chjK2A==","shasum":"d68af3965c646ae642d6e4c697431b4b312e0775","tarball":"http://registry-npm.ywwl.com/@putout/plugin-webpack/download/@putout/plugin-webpack-4.0.0.tgz","fileCount":8,"unpackedSize":11290,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC0Bky3mJO5uH6bUcPldYtpJlF89u4I5YHQ7AcdGfVRoQIhAOFRzcqaCQIQU8oF8Eu8g9tZ9yemZeEtbdeZjbcRgy7I"}],"size":3942,"noattachment":false,"key":"/@putout/plugin-webpack/-/@putout/plugin-webpack-4.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-webpack_4.0.0_1744980930138_0.6161170056278473"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-webpack [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-webpack.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-webpack\"npm\"\n\n> At its core, **webpack** is a static module bundler for modern **JavaScript** applications. When **webpack** processes your application, it internally builds a dependency graph from one or more entry points and then combines every module your project needs into one or more **bundles**, which are static assets to serve your content from.\n>\n> (c) [webpack.js.org](https://webpack.js.org/)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin helps to migrate to latest **webpack** version.\n\n## Install\n\n```\nnpm i @putout/plugin-webpack -D\n```\n\n## Rules\n\n```json\n{\n    \"rules\": {\n        \"webpack/apply-externals\": \"on\",\n        \"webpack/convert-loader-to-use\": \"on\",\n        \"webpack/convert-query-loader-to-use\": \"on\",\n        \"webpack/convert-node-to-resolve-fallback\": \"on\"\n    }\n}\n```\n\n## convert-loader-to-use\n\nFixes webpack comilation error: `Compiling RuleSet failed: Exclamation mark separated loader lists has been removed in favor of the 'use' property with arrays (at ruleSet[1].rules[1].loader: style-loader!css-loader!clean-css-loader)`\n\n### ❌ Example of incorrect code\n\n```js\nconst rules = [{\n    test: /\\.css$/,\n    loader: 'style-loader!css-loader!clean-css-loader',\n}];\n```\n\n### ✅ Example of correct code\n\n```js\nconst rules = [{\n    test: /\\.css$/,\n    use: [\n        'style-loader',\n        'css-loader',\n        'clean-css-loader',\n    ],\n}];\n```\n\n## convert-query-loader-to-use\n\nFixes webpack comilation error: `Compiling RuleSet failed: Query arguments on 'loader' has been removed in favor of the 'options' property`.\n\n### ❌ Example of incorrect code\n\n```js\nconst rules = [{\n    test: /\\.(png|gif|svg|woff|woff2|eot|ttf)$/,\n    loader: 'url-loader?limit=50000',\n}];\n```\n\n### ✅ Example of correct code\n\n```js\nconst rules = [{\n    test: /\\.(png|gif|svg|woff|woff2|eot|ttf)$/,\n    use: [{\n        loader: 'url-loader',\n        options: {\n            limit: 50_000,\n        },\n    }],\n}];\n```\n\n## convert-node-to-resolve-fallback\n\nFixes webpack comilation error:\n\n```\nModule not found: Error: Can't resolve 'path'`\n\nBREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.\nThis is no longer the case. Verify if you need this module and configure a polyfill for it.\n```\n\n### ❌ Example of incorrect code\n\n```js\nmodule.exports = {\n    node: {\n        path: 'empty',\n    },\n};\n```\n\n### ✅ Example of correct code\n\n```js\nmodule.exports = {\n    resolve: {\n        fallback: {\n            path: false,\n        },\n    },\n};\n```\n\n## convert-externals\n\nFixes webpack comilation error:\n\n```\n[DEP_WEBPACK_EXTERNALS_FUNCTION_PARAMETERS] DeprecationWarning: The externals-function should be defined like ({context, request}, cb) => { ... }\n```\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/23655fb64dcffb452f4b3a9f25ef3efd/6d0bc56cb4f0a439e26e6698694399918dd51a13).\n\n### ❌ Example of incorrect code\n\n```js\nmodule.exports = {\n    externals: [externals],\n};\n\nfunction externals(context, request, callback) {}\n```\n\n### ✅ Example of correct code\n\n```js\nmodule.exports = {\n    externals: [externals],\n};\n\nfunction externals({context, request}, callback) {}\n```\n\n## License\n\nMIT\n","publish_time":1744980930355,"_cnpm_publish_time":1744980930355,"dist-tags":{"latest":"4.0.0"}}