({ options }: BundlerCompiler)
| 2152 | |
| 2153 | // webpack's DefinePlugin holds its definitions, and Rspack's its arguments |
| 2154 | const definedProblemOf = ({ options }: BundlerCompiler) => { |
| 2155 | for (const plugin of options.plugins ?? []) { |
| 2156 | const { definitions, name, _args, constructor } = (plugin ?? |
| 2157 | {}) as DefinePluginLike |
| 2158 | // by name, as a config may construct it from another copy of webpack, |
| 2159 | // and not ProvidePlugin, which holds definitions of imports |
| 2160 | if (constructor?.name !== "DefinePlugin" && name !== "DefinePlugin") |
| 2161 | continue |
| 2162 | const problem = unreadDefineOf(definitions ?? _args?.[0]) |
| 2163 | if (problem) return problem |
| 2164 | } |
| 2165 | } |
| 2166 | |
| 2167 | // webpack leaves a side-effect-free module's re-exports unbuilt until a module |
| 2168 | // asks for their names, and forgets what was asked of one that had none. A |
no test coverage detected