Title: Transform hook run before load hook on webpack · Issue #324 · unjs/unplugin · GitHub
Open Graph Title: Transform hook run before load hook on webpack · Issue #324 · unjs/unplugin
X Title: Transform hook run before load hook on webpack · Issue #324 · unjs/unplugin
Description: Environment "unplugin": "^1.4.0", "webpack": "^5.88.2", Reproduction const unplugin = createUnplugin((options) => { return { name: 'test', load(id) { console.log(id,'load hook') return null }, transform() { console.log('transform hook') ...
Open Graph Description: Environment "unplugin": "^1.4.0", "webpack": "^5.88.2", Reproduction const unplugin = createUnplugin((options) => { return { name: 'test', load(id) { console.log(id,'load hook') return null }, tran...
X Description: Environment "unplugin": "^1.4.0", "webpack": "^5.88.2", Reproduction const unplugin = createUnplugin((options) => { return { name: 'test', load(id...
Opengraph URL: https://github.com/unjs/unplugin/issues/324
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Transform hook run before load hook on webpack","articleBody":"### Environment\n\n\"unplugin\": \"^1.4.0\",\r\n\"webpack\": \"^5.88.2\",\n\n### Reproduction\n\n```\r\nconst unplugin = createUnplugin((options) => {\r\n return {\r\n name: 'test',\r\n load(id) {\r\n console.log(id,'load hook')\r\n return null\r\n },\r\n transform() {\r\n console.log('transform hook')\r\n return null\r\n },\r\n buildStart() {\r\n console.log('build start hook')\r\n }\r\n }\r\n})\r\n```\r\n\r\nThe console outputs are:\r\n```\r\nbuild start hook\r\ntransform hook\r\nC:\\xxx\\src\\index.js load hook\r\n```\r\n\n\n### Describe the bug\n\nFrom the source code, I found out the transform hook was handled before the load hook. And `unshift()` was used to put the generated loader into the webpack config. Should the load hook be handled earlier than the transform hook?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_","author":{"url":"https://github.com/jzymx50","@type":"Person","name":"jzymx50"},"datePublished":"2023-07-25T03:39:31Z","url":"https://github.com/unjs/unplugin/issues/324"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d974fde-dd3b-6efa-9fe2-da63ac4c72a6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD1C:3E4AC7:2CF1508:3D3937D:6B0058FE |
| html-safe-nonce | e9bf1769a2f6523b37ddff45a4b76f2501e975c74ad0eaa420f92937b1b99890 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDFDOjNFNEFDNzoyQ0YxNTA4OjNEMzkzN0Q6NkIwMDU4RkUiLCJ2aXNpdG9yX2lkIjoiNjI0ODY3NjA5MTcxMjUyNjU5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0c0432eff4250c1cdb3d6af957cdff931c3932cd7da1ac6b4d4b176a8bb4406c |
| hovercard-subject-tag | issue:1819495149 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/unjs/unplugin/324/issue_layout |
| twitter:image | https://opengraph.githubassets.com/19a9aed2a2db291affd407fe5d8a1ae5513e71f168f56ee0e320cebae79256d1/unjs/unplugin/issues/324 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/19a9aed2a2db291affd407fe5d8a1ae5513e71f168f56ee0e320cebae79256d1/unjs/unplugin/issues/324 |
| og:image:alt | Environment "unplugin": "^1.4.0", "webpack": "^5.88.2", Reproduction const unplugin = createUnplugin((options) => { return { name: 'test', load(id) { console.log(id,'load hook') return null }, tran... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jzymx50 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| go-import | github.com/unjs/unplugin git https://github.com/unjs/unplugin.git |
| octolytics-dimension-user_id | 80154025 |
| octolytics-dimension-user_login | unjs |
| octolytics-dimension-repository_id | 385261169 |
| octolytics-dimension-repository_nwo | unjs/unplugin |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 385261169 |
| octolytics-dimension-repository_network_root_nwo | unjs/unplugin |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width