Open jzymx50 opened 1 year ago
"unplugin": "^1.4.0", "webpack": "^5.88.2",
const unplugin = createUnplugin((options) => { return { name: 'test', load(id) { console.log(id,'load hook') return null }, transform() { console.log('transform hook') return null }, buildStart() { console.log('build start hook') } } })
The console outputs are:
build start hook transform hook C:\xxx\src\index.js load hook
From 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?
unshift()
No response
I have the same question, can you tell me the answer ? please @antfu @sxzz
Please provide a minimal reproduction. Thanks.
https://antfu.me/posts/why-reproductions-are-required
Environment
"unplugin": "^1.4.0", "webpack": "^5.88.2",
Reproduction
The console outputs are:
Describe the bug
From 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?Additional context
No response
Logs
No response