Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hagevvashi/59f68735c9377bd0d0e945d7c5a4be70 to your computer and use it in GitHub Desktop.
Save hagevvashi/59f68735c9377bd0d0e945d7c5a4be70 to your computer and use it in GitHub Desktop.
react-refresh/babel の読み込みスキップ
module.exports = (api) => {
const isWeb = api.caller((caller) => {
if (caller) {
return caller.target === "web";
}
});
const isDevelopment = api.env("development");
api.cache(true);
return {
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "usage",
corejs: 3,
},
],
"@babel/typescript",
"@babel/preset-react",
],
plugins: [
isDevelopment && isWeb && "react-refresh/babel",
].filter(Boolean),
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment