{"id":15667884,"url":"https://github.com/rupurt/webpack-copy-after-build-plugin","last_synced_at":"2025-05-06T19:47:52.640Z","repository":{"id":57397396,"uuid":"67641784","full_name":"rupurt/webpack-copy-after-build-plugin","owner":"rupurt","description":"Copy files from a Webpack build","archived":false,"fork":false,"pushed_at":"2018-06-05T15:34:23.000Z","size":7,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T22:36:04.375Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rupurt.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":"2016-09-07T20:39:29.000Z","updated_at":"2024-04-08T20:49:40.000Z","dependencies_parsed_at":"2022-09-15T17:13:31.954Z","dependency_job_id":null,"html_url":"https://github.com/rupurt/webpack-copy-after-build-plugin","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/rupurt%2Fwebpack-copy-after-build-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupurt%2Fwebpack-copy-after-build-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupurt%2Fwebpack-copy-after-build-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupurt%2Fwebpack-copy-after-build-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rupurt","download_url":"https://codeload.github.com/rupurt/webpack-copy-after-build-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252758087,"owners_count":21799781,"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-10-03T14:05:44.582Z","updated_at":"2025-05-06T19:47:52.606Z","avatar_url":"https://github.com/rupurt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Webpack Copy After Build Plugin\n===============================\n\nA webpack plugin that allows webpack build artifacts to be included via sprockets\ndirectives. This helps reduce the onboarding time and friction when introducing \nWebpack into a legacy Rails application.\n\nInstall\n-------\n\n```bash\nnpm install webpack-copy-after-build-plugin --save\n```\n\nConfiguration\n-------------\n\nCreate a directory in the asset pipeline which will receive copied build files e.g.\n\n```\nmkdir -p app/assets/javascripts/generated\n```\n\nConfigure the plugin to copy the required bundles into the asset pipeline\n\n```javascript\n// client/webpack.config.js\nvar path = require(\"path\");\nvar WebpackSprocketsRailsManifestPlugin = require(\"webpack-sprockets-rails-manifest-plugin\");\n\nvar config = {\n  context: __dirname,\n\n  entry: {\n    \"webpack-application-bundle\": \"./bundles/webpack-application\"\n  },\n\n  output: {\n    path: path.resolve(__dirname, \"../public/assets\"),\n    filename: \"[name]-[chunkhash].js\"\n  },\n\n  // Other config ...\n\n  plugins: [\n    new WebpackSprocketsRailsManifestPlugin(),\n\n    new WebpackCopyAfterBuildPlugin({\n      \"webpack-application-bundle\":\n      \"../../app/assets/javascripts/generated/webpack-application-bundle.js\",\n    })\n  ]\n};\n```\n\n```javascript\n// client/bundles/webpack-application.js\nalert(\"Howdy, I'm a Webpack Javascript file that was required by a sprockets directive!\");\n```\n\nRequire the build artifact via a sprockets directive\n\n```javascript\n// app/assets/javascripts/application.js\n//= require ./generated/webpack-application-bundle\n```\n\nOptions and Defaults\n---------------------\n\n```javascript\n{\n  // The path that you give as the destination will be taken as absolute if this flag is set \n  absoluteMappingPaths : false\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupurt%2Fwebpack-copy-after-build-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frupurt%2Fwebpack-copy-after-build-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupurt%2Fwebpack-copy-after-build-plugin/lists"}