{"id":18802883,"url":"https://github.com/mrwilbroad/webpack-config-scope","last_synced_at":"2026-04-12T23:52:46.426Z","repository":{"id":212783475,"uuid":"732305559","full_name":"mrwilbroad/webpack-config-scope","owner":"mrwilbroad","description":"webpack configuration ","archived":false,"fork":false,"pushed_at":"2023-12-16T10:57:51.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-21T22:09:53.532Z","etag":null,"topics":["webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrwilbroad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-12-16T08:26:32.000Z","updated_at":"2023-12-16T08:29:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"325a0226-b2d9-437d-9f61-d43ff294830d","html_url":"https://github.com/mrwilbroad/webpack-config-scope","commit_stats":null,"previous_names":["mrwilbroad/webpack-config-scope"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrwilbroad/webpack-config-scope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwilbroad%2Fwebpack-config-scope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwilbroad%2Fwebpack-config-scope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwilbroad%2Fwebpack-config-scope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwilbroad%2Fwebpack-config-scope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrwilbroad","download_url":"https://codeload.github.com/mrwilbroad/webpack-config-scope/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwilbroad%2Fwebpack-config-scope/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272092449,"owners_count":24871953,"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-08-25T02:00:12.092Z","response_time":1107,"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":["webpack"],"created_at":"2024-11-07T22:31:32.303Z","updated_at":"2026-04-12T23:52:41.361Z","avatar_url":"https://github.com/mrwilbroad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpack-config-scope\n\n1. ## During css loading , this was configured to make sure even css style are transformed into appropriate bundle\n    ```js\n    module.exports = {\n    mode: \"production\",\n    entry: [path.resolve(__dirname, \"src/index.js\")],\n    output: {\n        path: path.resolve(__dirname, \"dist\"),\n        filename: \"bundle.js\",\n    },\n    module: {\n        rules: [\n        {\n            test: /\\.scss$/,\n            use: [\"style-loader\", \"css-loader\", \"sass-loader\"],\n        },\n        ],\n    }\n    };\n    ```\n\n\n\n2. ## After addition of HtmlWebpackPlugin for html template and other const value defintion\n   ```js\n   const path = require(\"node:path\");\n   const htmlwebpackplugin = require(\"html-webpack-plugin\");\n   const HtmlWebpackPlugin = require(\"html-webpack-plugin\");\n   module.exports = {\n    mode: \"production\",\n    entry: [\n        path.resolve(__dirname, \"src/index.js\")\n        ],\n    output: {\n        path: path.resolve(__dirname, \"dist\"),\n        filename: \"[name]-[contenthash].js\",\n        },\n    module: {\n        rules: [\n            {\n        test: /\\.scss$/,\n        use: [\"style-loader\", \"css-loader\", \"sass-loader\"],\n        },\n        ],\n        },\n        plugins: [\n            new HtmlWebpackPlugin({\n                title : \"WEBPACK Dev\",\n                filename: \"index.html\",\n                template:  \"public/index.html\"\n                })\n                ],\n                };\n    ```\n\n3. ## Addition Server configuration \n```js\ndevServer : {\n      static : {\n        directory : path.resolve(__dirname,\"dist\")\n      },\n      port: 3000,\n      open: true,\n      hot: true,\n      compress: true,\n      historyApiFallback : true\n  },\n  ```\n\n\n  4. But on loading and refreshing every time new HashFile as output is generated , to avoid multiple filed to be generated \n       - in \u003ccode\u003eoutput\u003c/code\u003e Block add \u003ccode\u003e clean: true\u003c/code\u003e\n        ```js\n        output: {\n            path: path.resolve(__dirname, \"dist\"),\n            filename: \"bundle-[fullhash].js\",\n            clean : true\n            },\n        ```\n\n\n5. Addition of \u003ccode\u003eSource map \u003c/code\u003e , This is for debuging your code when action problem is in the source code \n     - Easy to understand the source of error within your code\n     - Add this line as another block of statement in root of \u003ccode\u003emodule.export\u003c/code\u003e\n      [Recommended choice for production builds with high quality SourceMaps.](https://webpack.js.org/configuration/devtool/#root)\n     ```js\n       devtool: \"source-map\",\n      ```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrwilbroad%2Fwebpack-config-scope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrwilbroad%2Fwebpack-config-scope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrwilbroad%2Fwebpack-config-scope/lists"}