{"id":16256376,"url":"https://github.com/hmsk/symlink-webpack-plugin","last_synced_at":"2025-03-19T21:31:00.205Z","repository":{"id":47006217,"uuid":"87157025","full_name":"hmsk/symlink-webpack-plugin","owner":"hmsk","description":"🔗 Make symbolic links among files built by Webpack","archived":false,"fork":false,"pushed_at":"2021-10-12T15:56:11.000Z","size":351,"stargazers_count":6,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T00:00:02.085Z","etag":null,"topics":["static-site-generation","symlink","webpack","webpack-plugin"],"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/hmsk.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-04-04T06:58:14.000Z","updated_at":"2023-11-05T17:32:29.000Z","dependencies_parsed_at":"2022-08-26T10:41:31.844Z","dependency_job_id":null,"html_url":"https://github.com/hmsk/symlink-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmsk%2Fsymlink-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmsk%2Fsymlink-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmsk%2Fsymlink-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmsk%2Fsymlink-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmsk","download_url":"https://codeload.github.com/hmsk/symlink-webpack-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244507891,"owners_count":20463694,"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":["static-site-generation","symlink","webpack","webpack-plugin"],"created_at":"2024-10-10T15:45:04.755Z","updated_at":"2025-03-19T21:30:59.915Z","avatar_url":"https://github.com/hmsk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symlink Webpack Plugin\n\n[![](https://img.shields.io/npm/v/symlink-webpack-plugin.svg?style=for-the-badge)](https://www.npmjs.com/package/symlink-webpack-plugin)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/hmsk/symlink-webpack-plugin/Node%20CI?style=for-the-badge)](https://github.com/hmsk/symlink-webpack-plugin/actions?query=workflow%3A%22Node+CI%22)\n\nA webpack plugin to make symbolic links in output dir.\n\n## Installation\n\n```bash\nnpm i -D symlink-webpack-plugin\n```\n\n## Usage\n\nIn your webpack config:\n\n```js\nconst SymlinkWebpackPlugin = require('symlink-webpack-plugin');\n\nmodule.exports = {\n  // ...etc\n  plugins: [\n    new SymlinkWebpackPlugin({ origin: 'index.html', symlink: '200.html' })\n  ]\n};\n```\n\nThis setting makes symbolic link file `[ouput_path]/200.html` to `[ouput_path]/index.html`.\n\n### You can give configurations as Array\n\n```js\nconst SymlinkWebpackPlugin = require('symlink-webpack-plugin');\n\nmodule.exports = {\n  // ...etc\n  plugins: [\n    new SymlinkWebpackPlugin([\n      { origin: 'index.html', symlink: '200.html' },\n      { origin: 'index.html', symlink: 'error_pages/404.html' },\n    ])\n  ]\n};\n```\n\n### `force` option (default: `false`)\n\n```js\nconst SymlinkWebpackPlugin = require('symlink-webpack-plugin');\n\nmodule.exports = {\n  // ...etc\n  plugins: [\n    new SymlinkWebpackPlugin([\n      { origin: 'index.html', symlink: '200.html', force: true },\n      { origin: 'index.html', symlink: '404.html' },\n    ])\n  ]\n};\n```\n\nThe plugin doesn't make any symlink if a directory for a destination doesn't exist as default.\nPassing an option `force: true`, will create it regardless.\n\nWhen directories of symlink don't exist, `force` option allows to dig. For instance, what if a config has `symlink: 'one/two/200.html'` but `one/two/` dir doesn't exist when the plugin runs, `one`, `one/two` directories will be created.\n\n### `hook` option (default: `afterEmit`)\n\nYou can point an exact [compiler hook](https://webpack.js.org/api/compiler-hooks/) to make a symlink.\n\n```js\n  { origin: 'index.html', symlink: '200.html', hook: 'entryOption' },\n```\n\n\n## Development\n\n```bash\nyarn\nyarn test\n```\n\n## License\n\n[MIT](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmsk%2Fsymlink-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmsk%2Fsymlink-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmsk%2Fsymlink-webpack-plugin/lists"}