@lynx-js/rspeedy
Version:
A webpack/rspack-based frontend toolchain for Lynx
23 lines (22 loc) • 732 B
JavaScript
import { getESVersionTarget } from "./1~getESVersionTarget.js";
function isWeb(environment) {
const environmentName = 'string' == typeof environment ? environment : environment.name;
return 'web' === environmentName || environmentName.startsWith('web-');
}
function pluginTarget() {
return {
name: 'lynx:rsbuild:target',
setup (api) {
api.modifyBundlerChain((options, { environment })=>{
if (isWeb(environment)) options.target([
getESVersionTarget(),
'web'
]);
else options.target([
getESVersionTarget()
]);
});
}
};
}
export { pluginTarget };