mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-17 18:06:10 +08:00

* add logic to remove soucemap and merge sourcemap params * Update bundle.js --------- Co-authored-by: Sunny Luo <sunnylqm@gmail.com>
32 lines
579 B
TypeScript
32 lines
579 B
TypeScript
import fs from 'fs-extra';
|
|
|
|
interface PluginConfig {
|
|
name: string;
|
|
bundleParams?: {
|
|
[key: string]: any;
|
|
};
|
|
detect: () => Promise<boolean>;
|
|
}
|
|
|
|
export const plugins: PluginConfig[] = [
|
|
{
|
|
name: 'sentry',
|
|
bundleParams: {
|
|
sentry: true,
|
|
sourcemap: true,
|
|
},
|
|
detect: async () => {
|
|
try {
|
|
await fs.access('ios/sentry.properties');
|
|
return true;
|
|
} catch {
|
|
try {
|
|
await fs.access('android/sentry.properties');
|
|
return true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]; |