{"id":18674551,"url":"https://github.com/lightapis/rollup-plugin-html-location","last_synced_at":"2025-09-11T12:41:07.203Z","repository":{"id":203814064,"uuid":"710392441","full_name":"LightAPIs/rollup-plugin-html-location","owner":"LightAPIs","description":"Specify the output location of the html entry file","archived":false,"fork":false,"pushed_at":"2023-10-29T11:57:30.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-28T00:25:01.057Z","etag":null,"topics":["html","location","plugin","rollup","rollup-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/rollup-plugin-html-location","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/LightAPIs.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,"governance":null}},"created_at":"2023-10-26T15:47:22.000Z","updated_at":"2024-02-10T08:10:05.000Z","dependencies_parsed_at":"2023-10-29T12:29:05.562Z","dependency_job_id":null,"html_url":"https://github.com/LightAPIs/rollup-plugin-html-location","commit_stats":null,"previous_names":["lightapis/rollup-plugin-html-location"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightAPIs%2Frollup-plugin-html-location","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightAPIs%2Frollup-plugin-html-location/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightAPIs%2Frollup-plugin-html-location/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightAPIs%2Frollup-plugin-html-location/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LightAPIs","download_url":"https://codeload.github.com/LightAPIs/rollup-plugin-html-location/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239515973,"owners_count":19651866,"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":["html","location","plugin","rollup","rollup-plugin"],"created_at":"2024-11-07T09:19:21.919Z","updated_at":"2025-02-18T17:27:15.210Z","avatar_url":"https://github.com/LightAPIs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rollup-plugin-html-location\n\nSpecify the output location of the html entry file.\n\n## Installation\n\n```shell\nnpm install rollup-plugin-html-location -D\n```\n\n## Usage\n\nAssuming the project structure is as follows:\n\n```\n/\n├─src\n│  ├─demo\n│  │  ├─demo1\n│  │  │  └─index.html\n│  │  └─demo2\n│  │     └─index.html\n│  └─main.js\n├─package.json\n├─rollup.config.js\n└─...\n```\n\n### When without plugin\n\n```javascript\n// rollup.config.js\nexport default {\n  input: {\n    demo1: 'src/demo1/index.html',\n    demo2: 'src/demo2/index.html',\n    main: 'main.js',\n  },\n  output: {\n    dir: 'dist',\n    entryFileNames: '[name].js',\n  },\n};\n```\n\n**Output:**\n\n```\n├─dist\n│  ├─src\n│  │  ├─demo1\n│  │  │  └─index.html\n│  │  └─demo2\n│  │     └─index.html\n│  └─main.js\n└─...\n```\n\n### With plugin\n\n#### `dir` option\n\n```javascript\n// rollup.config.js\nimport HTMLLocation from 'rollup-plugin-html-location';\n\nexport default {\n  input: {\n    demo1: 'src/demo1/index.html',\n    demo2: 'src/demo2/index.html',\n    main: 'main.js',\n  },\n  output: {\n    dir: 'dist',\n    entryFileNames: '[name].js',\n  },\n  plugins: [\n    HTMLLocation({\n      dir: 'result',\n    }),\n  ],\n};\n```\n\n**Output:**\n\n```\n├─dist\n│  ├─result\n│  │  └─src\n│  │     ├─demo1\n│  │     │  └─index.html\n│  │     └─demo2\n│  │        └─index.html\n│  └─main.js\n└─...\n```\n\n#### `filename` option\n\n##### Use path key value pair\n\n```javascript\n// rollup.config.js\nimport HTMLLocation from 'rollup-plugin-html-location';\n\nexport default {\n  input: {\n    demo1: 'src/demo1/index.html',\n    demo2: 'src/demo2/index.html',\n    main: 'main.js',\n  },\n  output: {\n    dir: 'dist',\n    entryFileNames: '[name].js',\n  },\n  plugins: [\n    HTMLLocation({\n      filename: {\n        'src/demo1/index.html': 'result/demo1.html'\n        'src/demo2/index.html': 'result/demo2.html'\n      }\n    })\n  ],\n};\n```\n\n**Output:**\n\n```\n├─dist\n│  ├─result\n│  │  ├─demo1.html\n│  │  └─demo2.html\n│  └─main.js\n└─...\n```\n\n##### Use function\n\n```javascript\n// rollup.config.js\nimport HTMLLocation from 'rollup-plugin-html-location';\n\nexport default {\n  input: {\n    demo1: 'src/demo1/index.html',\n    demo2: 'src/demo2/index.html',\n    main: 'main.js',\n  },\n  output: {\n    dir: 'dist',\n    entryFileNames: '[name].js',\n  },\n  plugins: [\n    HTMLLocation({\n      filename: input =\u003e input.replace('src/', ''),\n    }),\n  ],\n};\n```\n\n**Output:**\n\n```\n├─dist\n│  ├─demo1\n│  │  └─index.html\n│  ├─demo2\n│  │  └─index.html\n│  └─main.js\n└─...\n```\n\n#### `disableClearEmptyFolder` option\n\n```javascript\n// rollup.config.js\nimport HTMLLocation from 'rollup-plugin-html-location';\n\nexport default {\n  input: {\n    demo1: 'src/demo1/index.html',\n    demo2: 'src/demo2/index.html',\n    main: 'main.js',\n  },\n  output: {\n    dir: 'dist',\n    entryFileNames: '[name].js',\n  },\n  plugins: [\n    HTMLLocation({\n      filename: {\n        'src/demo1/index.html': 'demo1.html'\n        'src/demo2/index.html': 'demo2.html'\n      },\n      disableClearEmptyFolder: true,\n    }),\n  ],\n};\n```\n\n**Output:**\n\n```\n├─dist\n│  ├─src\n│  │  ├─demo1\n│  │  └─demo2\n│  ├─demo1.html\n│  ├─demo2.html\n│  └─main.js\n└─...\n```\n\n#### `logging` option\n\n```javascript\n// rollup.config.js\nimport HTMLLocation from 'rollup-plugin-html-location';\n\nexport default {\n  input: {\n    demo1: 'src/demo1/index.html',\n    demo2: 'src/demo2/index.html',\n    main: 'main.js',\n  },\n  output: {\n    dir: 'dist',\n    entryFileNames: '[name].js',\n  },\n  plugins: [\n    HTMLLocation({\n      filename: {\n        'src/demo1/index.html': 'demo1.html'\n        'src/demo2/index.html': 'demo2.html'\n      },\n      logging: true,\n    }),\n  ],\n};\n```\n\nPrint operation log:\n\n```shell\nhtml-location:  [src/demo1/index.html] ==\u003e [demo1.html]\nhtml-location:  [src/demo2/index.html] ==\u003e [demo2.html]\nhtml-location:  clear empty folder!\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightapis%2Frollup-plugin-html-location","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightapis%2Frollup-plugin-html-location","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightapis%2Frollup-plugin-html-location/lists"}