{"id":48465530,"url":"https://github.com/sectsect/webpack-sweet-entry","last_synced_at":"2026-04-07T04:31:04.339Z","repository":{"id":44588723,"uuid":"114283594","full_name":"sectsect/webpack-sweet-entry","owner":"sectsect","description":"📦 webpack: Multiple entry points with glob pattern - Partial files named with a leading underscore - Preserve directory structure in dist directory","archived":false,"fork":false,"pushed_at":"2025-12-13T09:40:43.000Z","size":1927,"stargazers_count":20,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-30T12:40:05.719Z","etag":null,"topics":["dynamic","entrypoints","es6","glob","modules","partial","partial-files","rspack","typescript","webpack","webpack5","wildcards"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@sect/webpack-sweet-entry","language":"TypeScript","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/sectsect.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-12-14T18:31:33.000Z","updated_at":"2025-12-13T09:39:59.000Z","dependencies_parsed_at":"2024-06-21T04:17:48.517Z","dependency_job_id":"266c927b-81d2-4f1c-bedf-2b798b0ad241","html_url":"https://github.com/sectsect/webpack-sweet-entry","commit_stats":{"total_commits":230,"total_committers":5,"mean_commits":46.0,"dds":"0.23913043478260865","last_synced_commit":"17fac6b95009a418c93c4556602b04f29494faa8"},"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"purl":"pkg:github/sectsect/webpack-sweet-entry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwebpack-sweet-entry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwebpack-sweet-entry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwebpack-sweet-entry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwebpack-sweet-entry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sectsect","download_url":"https://codeload.github.com/sectsect/webpack-sweet-entry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fwebpack-sweet-entry/sbom","scorecard":{"id":809149,"data":{"date":"2025-08-11","repo":{"name":"github.com/sectsect/webpack-sweet-entry","commit":"be367c8a9087a5a8d99e4b09b9eb11f12e414347"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Maintained","score":7,"reason":"9 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Code-Review","score":0,"reason":"Found 0/18 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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/sectsect/webpack-sweet-entry/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/sectsect/webpack-sweet-entry/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/sectsect/webpack-sweet-entry/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/sectsect/webpack-sweet-entry/test.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:40","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/test.yml:4","Warn: topLevel 'packages' permission set to 'write': .github/workflows/test.yml:6","Info: no jobLevel write permissions found"],"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":"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":1,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Warn: 'force pushes' enabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: could not determine whether codeowners review is allowed","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"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"}},{"name":"SAST","score":3,"reason":"SAST tool is not run on all commits -- score normalized to 3","details":["Warn: 5 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T12:38:21.505Z","repository_id":44588723,"created_at":"2025-08-23T12:38:21.505Z","updated_at":"2025-08-23T12:38:21.505Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31500397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dynamic","entrypoints","es6","glob","modules","partial","partial-files","rspack","typescript","webpack","webpack5","wildcards"],"created_at":"2026-04-07T04:31:04.272Z","updated_at":"2026-04-07T04:31:04.334Z","avatar_url":"https://github.com/sectsect.png","language":"TypeScript","readme":"# @sect/webpack-sweet-entry\n[![Release](https://github.com/sectsect/webpack-sweet-entry/actions/workflows/release.yml/badge.svg)](https://github.com/sectsect/webpack-sweet-entry/actions/workflows/release.yml) [![codecov](https://codecov.io/gh/sectsect/webpack-sweet-entry/branch/master/graph/badge.svg?token=0EKNBV7VK1)](https://codecov.io/gh/sectsect/webpack-sweet-entry) [![CodeQL](https://github.com/sectsect/webpack-sweet-entry/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/sectsect/webpack-sweet-entry/actions/workflows/github-code-scanning/codeql)\n\nMultiple entry points with glob pattern / Ignore files and directories with leading underscore `_` / Preserve directory structure \n\n## Install\n```\nnpm install --save-dev @sect/webpack-sweet-entry\n```\n## Features\n- Multiple entry points with glob pattern.\n- Ignore files and directories with leading underscore `_`.\n- Preserve directory structure in `dist` directory.\n- Dual Package Support (CommonJS and ES Modules).\n\n\n## Usage Example\n\n### CommonJS\n```js\nconst webpack = require('webpack');\nconst path = require('path');\nconst { WebpackSweetEntry } = require('@sect/webpack-sweet-entry');\n\nconst sourcePath = path.join(__dirname, 'src');\nconst buildPath = path.join(__dirname, 'dist');\n\nmodule.exports = [\n  {\n    entry: WebpackSweetEntry(path.resolve(sourcePath, 'assets/js/**/*.js*'), 'js', 'js'),\n    output: {\n      path: path.resolve(buildPath, 'assets/js'),\n      filename: '[name].js',\n    },\n    module: {\n      ...\n    }\n  },\n  {\n    entry: WebpackSweetEntry(path.resolve(sourcePath, 'assets/css/**/*.css'), 'css', 'css'),\n    output: {\n      path: path.resolve(buildPath, 'assets/css'),\n      filename: '[name].css',\n    },\n    module: {\n      ...\n    }\n  }\n];\n```\n\n### ES Modules\n```js\nimport webpack from 'webpack';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { dirname } from 'path';\nimport { WebpackSweetEntry } from '@sect/webpack-sweet-entry';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nconst sourcePath = path.join(__dirname, 'src');\nconst buildPath = path.join(__dirname, 'dist');\n\nexport default [\n  {\n    entry: WebpackSweetEntry(path.resolve(sourcePath, 'assets/js/**/*.js*'), 'js', 'js'),\n    output: {\n      path: path.resolve(buildPath, 'assets/js'),\n      filename: '[name].js',\n    },\n    module: {\n      ...\n    }\n  },\n  {\n    entry: WebpackSweetEntry(path.resolve(sourcePath, 'assets/css/**/*.css'), 'css', 'css'),\n    output: {\n      path: path.resolve(buildPath, 'assets/css'),\n      filename: '[name].css',\n    },\n    module: {\n      ...\n    }\n  }\n];\n```\n\n### TypeScript\n```ts\nimport webpack from 'webpack';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { dirname } from 'path';\nimport { WebpackSweetEntry } from '@sect/webpack-sweet-entry';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nconst sourcePath = path.join(__dirname, 'src');\nconst buildPath = path.join(__dirname, 'dist');\n\nconst config: webpack.Configuration[] = [\n  {\n    entry: WebpackSweetEntry(path.resolve(sourcePath, 'assets/js/**/*.js*'), 'js', 'js'),\n    output: {\n      path: path.resolve(buildPath, 'assets/js'),\n      filename: '[name].js',\n    },\n    module: {\n      ...\n    }\n  },\n  {\n    entry: WebpackSweetEntry(path.resolve(sourcePath, 'assets/css/**/*.css'), 'css', 'css'),\n    output: {\n      path: path.resolve(buildPath, 'assets/css'),\n      filename: '[name].css',\n    },\n    module: {\n      ...\n    }\n  }\n];\n\nexport default config;\n```\n\n### Multiple(Mixed) extensions\n```ts\nconst config: webpack.Configuration[] = [\n  {\n    entry: WebpackSweetEntry(path.resolve(sourcePath, 'assets/scripts/**/*.*s*'), ['ts', 'js'], 'scripts'),\n    output: {\n      ...\n    },\n    module: {\n      ...\n    }\n  },\n  ...\n];\n```\n\n## API\n```js\nWebpackSweetEntry(path, ext, parentdir);\n```\n\n| arg | type | Description | Example |\n| ---- | ---- | ----------- | ------- |\n| path | `string` \\| `string[]` | File path glob(s) | `path.resolve(sourcePath, 'assets/js/**/*.js*')` or `[path.resolve(sourcePath, 'assets/js/**/*.js*'), '!**/a.js']` |\n| ext | `string` \\| `string[]` | File extension | `js` or `['ts', 'js']`\n| parentdir | `string` | Parent Dirctory Name for files (The directory name where the tree starts) | `js` |\n\nReturns `object` like the following.\n\n```js\n{\n  a: '/path/to/your/src/assets/js/a.js',\n  b: '/path/to/your/src/assets/js/b.js',\n  'dir/e': '/path/to/your/src/assets/js/dir/e.js'\n}\n{\n  a: '/path/to/your/src/assets/css/a.css',\n  b: '/path/to/your/src/assets/css/b.css',\n  'dir/e': '/path/to/your/src/assets/css/dir/e.css'\n}\n```\n\n\n### Build Result\n```\n.\n├── dist\n│   └── assets\n│       ├── css\n│       │   ├── a.css\n│       │   ├── b.css\n│       │   └── dir\n│       │       └── e.css\n│       └── js\n│           ├── a.js\n│           ├── b.js\n│           └── dir\n│               └── e.js\n├── src\n│   └── assets\n│       ├── css\n│       │   ├── a.css\n│       │   ├── b.css\n│       │   ├── _c.css\n│       │   ├── _d.css\n│       │   └── dir\n│       │       ├── e.css\n│       │       └── _f.css\n│       └── js\n│           ├── a.js\n│           ├── b.js\n│           ├── _c.js\n│           ├── _d.js\n│           ├── _modules\n│           │   ├── a.js\n│           │   └── b.js\n│           └── dir\n│               ├── e.js\n│               └── _f.js\n├── package-lock.json\n├── package.json\n└── webpack.config.js\n```\n\n## Migrate from v1\n```\n$ npm uninstall webpack-sweet-entry\n$ npm install --save-dev @sect/webpack-sweet-entry\n```\n\n```diff\n- const WebpackSweetEntry = require('webpack-sweet-entry');\n+ const { WebpackSweetEntry } = require('@sect/webpack-sweet-entry');\n```\n\n## Development\n\n### Making Changes\n\nWhen you make a change that should be included in the next release:\n\n1. Create a feature branch\n2. Make your changes\n3. Add a changeset: `npm run changeset`\n   - Select the type of change (patch/minor/major)\n   - Provide a description of the change\n4. Commit the changeset file along with your changes\n5. Create a pull request\n\n### Release Process\n\nThis project uses [changesets](https://github.com/changesets/changesets) for version management and releases.\n\n**Automated Release Workflow:**\n1. When a PR with changesets is merged to master, a \"Version Packages\" PR is automatically created\n2. The Version Packages PR includes:\n   - Updated version numbers in package.json\n   - Updated CHANGELOG.md\n   - Removed changeset files\n3. When the Version Packages PR is merged:\n   - The package is automatically built\n   - Published to npm with provenance\n   - A GitHub release is created\n\n**Manual Testing:**\n```bash\n# Create a test changeset\nnpm run changeset\n\n# Preview version bump (without publishing)\nnpm run version-packages\n\n# Build and test before release\nnpm run build\nnpm test\nnpm run lint\n```\n\n## Changelog\n\nSee [CHANGELOG](https://github.com/sectsect/webpack-sweet-entry/blob/master/CHANGELOG.md) file.\n\n\u003cp align=\"center\"\u003e✌️\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003csub\u003e\u003csup\u003eA little project by \u003ca href=\"https://github.com/sectsect\"\u003e@sectsect\u003c/a\u003e\u003c/sup\u003e\u003c/sub\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectsect%2Fwebpack-sweet-entry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsectsect%2Fwebpack-sweet-entry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectsect%2Fwebpack-sweet-entry/lists"}