{"id":17497916,"url":"https://github.com/moox/webpack-easy-config","last_synced_at":"2025-04-13T13:12:29.241Z","repository":{"id":66070888,"uuid":"54844885","full_name":"MoOx/webpack-easy-config","owner":"MoOx","description":"Webpack config, made easy","archived":false,"fork":false,"pushed_at":"2016-04-05T09:22:27.000Z","size":8,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T13:04:27.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/MoOx.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-27T19:35:42.000Z","updated_at":"2022-12-14T18:46:48.000Z","dependencies_parsed_at":"2023-02-20T19:30:54.113Z","dependency_job_id":null,"html_url":"https://github.com/MoOx/webpack-easy-config","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"314b51f52d3cdedbcf917f3ce9f85fef736460db"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fwebpack-easy-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fwebpack-easy-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fwebpack-easy-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fwebpack-easy-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoOx","download_url":"https://codeload.github.com/MoOx/webpack-easy-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717237,"owners_count":21150389,"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-10-19T16:01:25.296Z","updated_at":"2025-04-13T13:12:29.210Z","avatar_url":"https://github.com/MoOx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpack-easy-config\n\n[![Unix Build status](https://img.shields.io/travis/MoOx/webpack-easy-config/master.svg?branch=master\u0026label=unix%20build)](https://travis-ci.org/MoOx/webpack-easy-config)\n[![Code Coverage](https://img.shields.io/coveralls/MoOx/webpack-easy-config/master.svg)](https://coveralls.io/github/MoOx/webpack-easy-config)\n[![Version](https://img.shields.io/npm/v/webpack-easy-config.svg)](https://github.com/MoOx/webpack-easy-config/blob/master/CHANGELOG.md)\n[![Support on gitter chat](https://img.shields.io/badge/support-gitter%20chat-E40255.svg)](https://gitter.im/MoOx/webpack-easy-config)\n\n\u003e Webpack config, made easy\n\nIdeas:\n\n- simpler config\n- fix loaders order (imo, more logical order): proof is that\n  [most webpack users don't get this part](https://twitter.com/MoOx/status/710400696449933313)\n- no tons of way to provide config via string, query etc\n- some shortcuts: simple extract, aliases\n\nNote that you can provide normal configuration before or after special keys handled by this package. Order should be respected.\n\n## Installation\n\n```console\n$ npm install webpack-easy-config\n```\n\n## Usage\n\n```js\nimport webpackEasyConfig from \"webpack-easy-config\"\n\nexport default webpackEasyConfig({\n  include: \"src\", // relative to process.cwd(), or can be absolute\n  // can also be an array like\n  // include: [ \"src\", \"web_modules\" ],\n  loaders: {\n    css: {\n      \"postcss-loader\": true,\n      \"css-loader\": {\n        modules: true,\n        localIdentName: \"[path][name]--[local]--[hash:base64:5]\",\n      },\n      \"style-loader\": true,\n    },\n    \"html|ico|jpe?g|png|gif\": {\n      \"file-loader\": {\n        name: \"[path][name].[ext]\",\n        context: \"src\",\n      },\n    },\n    \"svg\": [ \"svgo-loader\", \"raw-loader\" ],\n    \"woff2|woff|ttf|eot\": \"file-loader\",\n  },\n  extract: {\n    css: {\n      filename: \"[name].[hash].css\",\n      disable: process.argv.indexOf(\"--dev\") \u003e -1,\n    },\n  },\n})\n```\n\nWill generate the equivalent config\n\n```js\nexport default {\n  module: {\n    loaders: [\n      {\n        test: /\\.css$/,\n        loader: ExtractTextPlugin.extract(\n          \"style-loader\",\n          \"css-loader\" +\n            \"?modules\" +\n            \"\u0026localIdentName=[path][name]--[local]--[hash:base64:5]\" +\n          \"!postcss-loader!\"\n        ),\n        include: `/absolute/path/to/src`,\n      },\n      {\n        test: /\\.(html|ico|jpe?g|png|gif)$/,\n        loader:\n          \"file-loader\" +\n          \"?name=[path][name].[ext]\" +\n          \"\u0026context=src\",\n        include: `/absolute/path/to/src`,\n      },\n      {\n        test: /\\.svg$/,\n        loader: \"raw-loader!svgo-loader\",\n        include: `/absolute/path/to/src`,\n      },\n      {\n        test: /\\.(woff2|woff|ttf|eot)$/,\n        loader: \"file-loader\",\n        include: `/absolute/path/to/src`,\n      },\n    ],\n  },\n  plugins: [\n    new ExtractTextPlugin(\"[name].[hash].css\", {\n      disable: process.argv.indexOf(\"--dev\") \u003e -1\n    })\n  ],\n}\n```\n\n---\n\n## CONTRIBUTING\n\n* ⇄ Pull requests and ★ Stars are always welcome.\n* For bugs and feature requests, please create an issue.\n* Pull requests must be accompanied by passing automated tests (`$ npm test`).\n\n## [CHANGELOG](CHANGELOG.md)\n\n## [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Fwebpack-easy-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoox%2Fwebpack-easy-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Fwebpack-easy-config/lists"}