{"id":15753735,"url":"https://github.com/marella/webpack-setup","last_synced_at":"2026-04-09T11:01:11.633Z","repository":{"id":57397494,"uuid":"97393800","full_name":"marella/webpack-setup","owner":"marella","description":"[DEPRECATED] Webpack config simplified.","archived":false,"fork":false,"pushed_at":"2021-06-08T20:59:58.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-19T05:26:17.276Z","etag":null,"topics":["babel","config","react","sass","webpack"],"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/marella.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-07-16T15:50:56.000Z","updated_at":"2021-07-06T12:00:52.000Z","dependencies_parsed_at":"2022-09-11T02:10:48.225Z","dependency_job_id":null,"html_url":"https://github.com/marella/webpack-setup","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/marella/webpack-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fwebpack-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fwebpack-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fwebpack-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fwebpack-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marella","download_url":"https://codeload.github.com/marella/webpack-setup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marella%2Fwebpack-setup/sbom","scorecard":{"id":618811,"data":{"date":"2025-08-11","repo":{"name":"github.com/marella/webpack-setup","commit":"f2bbf286bdfad25cc93305d31b937358bdef20ec"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-21T04:42:52.575Z","repository_id":57397494,"created_at":"2025-08-21T04:42:52.576Z","updated_at":"2025-08-21T04:42:52.576Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278755163,"owners_count":26040034,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","config","react","sass","webpack"],"created_at":"2024-10-04T07:41:52.900Z","updated_at":"2025-10-07T09:57:30.204Z","avatar_url":"https://github.com/marella.png","language":"JavaScript","readme":"# webpack-setup\n\n[Webpack config] simplified.\n\n\u003c!-- TOC depthFrom:2 depthTo:3 withLinks:1 updateOnSave:1 orderedList:0 --\u003e\n\n- [Installation](#installation)\n- [Example](#example)\n- [Documentation](#documentation)\n\t- [Available Methods](#available-methods)\n\t- [Custom Config](#custom-config)\n- [License](#license)\n\n\u003c!-- /TOC --\u003e\n\n## Installation\n\n```bash\nnpm install --save-dev webpack-setup\n```\n\n\n## Example\n\n*webpack.config.js*\n\n```js\nconst setup = require('webpack-setup')\n\nsetup\n  .init({\n    output: 'build',\n  })\n  .js('src/index.js', 'js')\n  .eslint('src', { 'extends': 'eslint:recommended' })\n  .babel('src', { presets: ['es2015'] })\n  .sass('src/styles', 'css')\n\nmodule.exports = setup.config\n```\n\n\n## Documentation\n\nThe first method `init()` initializes the config object using the provided `settings`. Rest of the methods update the config object by adding rules, loaders, plugins etc. The `setup.config` is the webpack config object that should be exported at the end.\n\nDefault `settings`:\n\n```js\n{\n  base: '/', // base public path on server where you will host the application\n  bundles: [], // names passed to CommonsChunkPlugin\n  env: process.env.NODE_ENV, // 'development' or 'production'\n  main: 'app', // key name for main entry point NOT the actual file path\n  modules: [], // to resolve absolute imports\n  output: 'build', // directory to save the final build\n  polyfill: false, // when true uses 'babel-polyfill' or you can provide a file path to your custom polyfill\n  production: process.env.NODE_ENV === 'production', // when true runs some optimizations which can be slow for development\n  versioning: process.env.NODE_ENV === 'production', // when true adds [hash] to output filenames. useful for cache busting on production but can be slow for development\n  sourcemaps: process.env.NODE_ENV === 'production' ? false : 'cheap-module-source-map', // whether to generate sourcemaps or not\n}\n```\n\n### Available Methods\n\n#### `babel(src, options = {})`\n\nConfigures `babel-loader` to compile JS files. `src` specifies the directory paths to include for compilation. `options` object is passed as `babel-loader` options.\n\n```js\nsetup\n  .babel('src', { presets: ['es2015'] })\n```\n\n#### `copy(patterns, options = {})`\n\nCopies files and directories using `copy-webpack-plugin`. `patterns` array and `options` object are passed to the plugin.\n\n```js\nsetup\n  .copy([{ from: 'public' }])\n```\n\n#### `define(globals = {})`\n\nList of globals passed to `DefinePlugin`. `process.env.NODE_ENV` is automatically set.\n\n```js\nsetup\n  .define({\n    'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV) },\n  })\n```\n\n#### `eslint(src, options = {})`\n\nConfigures `eslint-loader` for JS files. `src` specifies the directory paths to include for linting. `options` object is passed as `eslint-loader` options.\n\n```js\nsetup\n  .eslint('src', { 'extends': 'eslint:recommended' })\n```\n\n#### `externals(externals)`\n\nDependencies to exclude from output bundles.\n\n```js\nsetup\n  .externals({\n    jquery: 'jQuery',\n  })\n```\n\n#### `fonts(dst, options = {})`\n\nConfigures `file-loader` to load fonts. `dst` specifies the output directory of font files relative to the `settings.output` directory. `options` object is passed as `file-loader` options.\n\n```js\nsetup\n  .fonts('fonts')\n```\n\n#### `hot()`\n\nEnables HMR using `HotModuleReplacementPlugin`.\n\n```js\nsetup\n  .hot()\n```\n\n#### `html(src, options = {})`\n\nSpecify the file using `src` that should be loaded using `html-webpack-plugin`. `options` object is passed to the plugin.\n\n```js\nsetup\n  .html('public/index.html')\n```\n\n#### `images(dst, options = {})`\n\nConfigures `file-loader` to load images. `dst` specifies the output directory of image files relative to the `settings.output` directory. `options` object is passed as `file-loader` options.\n\n```js\nsetup\n  .images('img')\n```\n\n#### `init(settings = {})`\n\nThe first method that should be called to initialize the config object.\n\n```js\nsetup\n  .init({\n    output: 'build',\n  })\n```\n\n#### `js(src, dst)`\n\nSpecify the entry point using `src` and output directory of compiled JS files using `dst`. Output directory is relative to the `settings.output` directory.\n\n```js\nsetup\n  .js('src/index.js', 'js')\n```\n\n#### `notify(options = {})`\n\nConfigures `WebpackNotifierPlugin` using `options` object. Displays a desktop notification after every compilation.\n\n```js\nsetup\n  .notify()\n```\n\n#### `react(src, options = {})`\n\nConfigures `babel-loader` to compile ES6 and JSX syntax. `src` specifies the directory paths to include for compilation. `options` object is passed as `babel-loader` options.\n\n```js\nsetup\n  .react('src')\n```\n\n#### `sass(src, dst, options = {})`\n\nConfigures `sass-loader` using `src` as `includePaths` and `dst` as output directory of compiled CSS files. Output directory is relative to the `settings.output` directory. `options` object is passed as `sass-loader` options. Styles are separated from `js` files using `extract-text-webpack-plugin`.\n\n```js\nsetup\n  .sass('src/styles', 'css')\n```\n\n#### `server(options = {})`\n\nConfigures `webpack-dev-server` using `options` object.\n\n```js\nsetup\n  .server()\n```\n\n#### `settings(values = {})`\n\nOverrides the initial `settings` with provided `values`. Methods called before `settings()` are not affected.\n\n```js\nsetup\n  .first()\n  .settings({\n    foo: 'bar'\n  })\n  // this affects only second() and third() NOT first() as it was already called\n  .second()\n  .third()\n```\n\n#### `uglify(options = {})`\n\nConfigures `UglifyJsPlugin` using `options` object.\n\n```js\nsetup\n  .uglify()\n```\n\n#### `vendors(vendors = [])`\n\nList of modules that should be bundled into a separate `vendor.js` file.\n\n```js\nsetup\n  .vendors([\n    'react',\n    'react-dom',\n  ])\n```\n\n#### `when(env, match = true)`\n\nUseful for writing environment specific config using `process.env.NODE_ENV`. `match` denotes whether it should match or shouldn't match.\n\n```js\nsetup\n  .when('development')\n  .server() // called only when env is development\n  .hot() // called only when env is development\n\n  .when('production')\n  .uglify() // called only when env is production\n\n  .when('any')\n  .notify() // called always\n\n  .when('production', false)\n  .notify() // called only when env is NOT production\n```\n\n### Custom Config\n\nYou may modify the config object before exporting to add custom rules or plugins that are not provided by `webpack-setup`:\n\n```js\nconst { config } = setup\n\n// Add custom rules or plugins here.\n\nmodule.exports = config\n```\n\n\n## License\n\n[MIT][license]\n\n\n[license]: /LICENSE\n[Webpack config]: https://webpack.js.org/configuration/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarella%2Fwebpack-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarella%2Fwebpack-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarella%2Fwebpack-setup/lists"}