-
Hi, im trying to write simple plugin that adds extensions in configuration. I write this logic in my plugin: compiler.hooks.afterEnvironment.tap('MyPlugin', () => {
if (!compiler.options.resolve.extensions) {
compiler.options.resolve.extensions = ['...'];
}
const { extensions } = compiler.options.resolve;
for (const ext of ['.ts', '.tsx']) {
if (!extensions.includes(ext)) {
extensions.push(ext);
}
}
}); Its working only when extensions provided in configuration object. Even if empty array is provided. It is not working if Is it bug or do I something wrong? |
Beta Was this translation helpful? Give feedback.
Answered by
krutoo
Feb 18, 2025
Replies: 1 comment
-
The detailed answer for same question in Webpack is here: It is works for Rspack too |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
krutoo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The detailed answer for same question in Webpack is here:
webpack/webpack#19170 (comment)
It is works for Rspack too