{"id":13775015,"url":"https://github.com/jacksonrayhamilton/rollup-plugin-shift-header","last_synced_at":"2025-05-11T07:31:49.388Z","repository":{"id":77080955,"uuid":"106897788","full_name":"jacksonrayhamilton/rollup-plugin-shift-header","owner":"jacksonrayhamilton","description":"Shift a \"comment header\" to the top of a bundle","archived":false,"fork":false,"pushed_at":"2017-10-14T04:40:06.000Z","size":7,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-16T18:46:21.980Z","etag":null,"topics":[],"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/jacksonrayhamilton.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,"roadmap":null,"authors":null}},"created_at":"2017-10-14T04:24:09.000Z","updated_at":"2017-11-02T16:33:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee26e7e4-6082-4811-85d6-2b0b13bab291","html_url":"https://github.com/jacksonrayhamilton/rollup-plugin-shift-header","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksonrayhamilton%2Frollup-plugin-shift-header","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksonrayhamilton%2Frollup-plugin-shift-header/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksonrayhamilton%2Frollup-plugin-shift-header/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksonrayhamilton%2Frollup-plugin-shift-header/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacksonrayhamilton","download_url":"https://codeload.github.com/jacksonrayhamilton/rollup-plugin-shift-header/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225027328,"owners_count":17409411,"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":[],"created_at":"2024-08-03T17:01:32.827Z","updated_at":"2024-11-17T10:30:26.929Z","avatar_url":"https://github.com/jacksonrayhamilton.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Output"],"readme":"# rollup-plugin-shift-header\n\nIf you have a \"comment header\" embedded in your source code, like this:\n\n```js\n// Copyright © 2017 Jackson Ray Hamilton\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the “Software”), to deal\n// ...\n\nexport default function foo () {}\n```\n\nThen, normally, when you generate an IIFE bundle, you'll get this:\n\n```js\nvar foo = (function () {\n'use strict';\n\n// Copyright © 2017 Jackson Ray Hamilton\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the “Software”), to deal\n// ...\n\nfunction foo () {}\n\nreturn foo;\n\n}());\n```\n\nIt would be better if your \"comment header\" remained at the top of your\ngenerated file, like this:\n\n```js\n// Copyright © 2017 Jackson Ray Hamilton\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the “Software”), to deal\n// ...\n\nvar foo = (function () {\n'use strict';\n\nfunction foo () {}\n\nreturn foo;\n\n}());\n```\n\nThis plugin ensures that a \"comment header\" (the first series of comments in a\nfile, separated by up to one empty newline) is shifted to the top of your\ngenerated bundle.\n\n## Usage\n\nIn `rollup.config.js`, call `shiftHeader()` and add the result to your `plugins`\narray:\n\n```js\nimport shiftHeader from 'rollup-plugin-shift-header';\n\nexport default [\n  {\n    input: 'foo.mjs',\n    output: {\n      file: 'foo.js',\n      name: 'foo',\n      format: 'iife',\n    },\n    plugins: [\n      shiftHeader(),\n    ],\n  },\n];\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksonrayhamilton%2Frollup-plugin-shift-header","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacksonrayhamilton%2Frollup-plugin-shift-header","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksonrayhamilton%2Frollup-plugin-shift-header/lists"}