{"id":27156605,"url":"https://github.com/jverneaut/gutenberg-webpack-plugin","last_synced_at":"2025-08-10T23:35:00.341Z","repository":{"id":286692272,"uuid":"962237474","full_name":"jverneaut/gutenberg-webpack-plugin","owner":"jverneaut","description":"A lightweight, developer-friendly alternative to @wordpress/scripts that simplifies the setup and build process for custom Gutenberg blocks.","archived":false,"fork":false,"pushed_at":"2025-06-03T18:22:23.000Z","size":671,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-08T18:35:23.552Z","etag":null,"topics":["gutenberg","webpack"],"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/jverneaut.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":"2025-04-07T21:22:41.000Z","updated_at":"2025-06-03T18:22:07.000Z","dependencies_parsed_at":"2025-04-07T22:41:28.784Z","dependency_job_id":null,"html_url":"https://github.com/jverneaut/gutenberg-webpack-plugin","commit_stats":null,"previous_names":["jverneaut/gutenberg-webpack-plugin"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jverneaut/gutenberg-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jverneaut","download_url":"https://codeload.github.com/jverneaut/gutenberg-webpack-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-webpack-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269806233,"owners_count":24478157,"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-10T02:00:08.965Z","response_time":71,"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":["gutenberg","webpack"],"created_at":"2025-04-08T20:31:09.261Z","updated_at":"2025-08-10T23:35:00.330Z","avatar_url":"https://github.com/jverneaut.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GutenbergWebpackPlugin\n\nA lightweight webpack plugin that simplifies the setup and build process for custom Gutenberg blocks. It’s designed to integrate easily into any existing Webpack configuration with minimal boilerplate.\n\nIt uses a lot of parts from [@worpress/scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/).\n\nIt also integrates nicely with my other package: [HTML To Gutenberg](https://github.com/jverneaut/html-to-gutenberg).\n\n## Installation\n\n```sh\n# Install GutenbergWebpackPlugin\nnpm install --save-dev @jverneaut/gutenberg-webpack-plugin\n\n# Install Webpack (if not already set up)\nnpm install --save-dev webpack webpack-cli\n```\n\n## Usage\n\n```js\n// webpack.config.js\nimport GutenbergWebpackPlugin from \"@jverneaut/gutenberg-webpack-plugin\";\n\nexport default {\n  entry: \"./index.js\", // your main app entry for non-Gutenberg stuff\n\n  plugins: [\n    // \"./blocks\" is your blocks folder\n    new GutenbergWebpackPlugin(\"./blocks\", {\n      outputPathPrefix: \"blocks\", // optional, default is \"blocks\"\n    }),\n  ],\n};\n```\n\nIf you have issues making it work with an existing webpack config that is already setup to build CSS and SASS files, you can use the `disableCssLoaders` and `disableSassLoaders` options.\n\n```js\nnew GutenbergWebpackPlugin(\"./blocks\", {\n  disableCssLoaders: true,\n  disableScssLoaders: true,\n});\n```\n\nThis will prevent conflicts between the two and should properly handle styles as long as your webpack config is standard enough.\n\n## Block Structure\n\nGiven an input folder that looks like this:\n\n```\nblocks/\n└── example-block/\n    ├── block.json\n    ├── edit.js\n    ├── index.js\n    └── render.php\n```\n\nIn your block.json, reference files like so:\n\n```json\n{\n  \"name\": \"custom/example-block\",\n  \"editorScript\": \"file:./index.js\",\n  \"render\": \"file:./render.php\"\n}\n```\n\nThe plugin will:\n\n- Add index.js as a Webpack entry named `blocks/custom/example-block/index`\n- Copy `block.json`, `render.php`, and any other referenced files into the final build output directory\n- Create the `*.asset.php` files with `@wordpress/dependency-extraction-webpack-plugin`\n\n## Output\n\nOutput files will be written to:\n\n```\ndist/\n└── blocks/\n    └── custom/\n        └── example-block/\n            ├── block.json\n            ├── index.asset.php\n            ├── index.js\n            ├── render.php\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjverneaut%2Fgutenberg-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjverneaut%2Fgutenberg-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjverneaut%2Fgutenberg-webpack-plugin/lists"}