Created
November 24, 2020 17:44
-
-
Save hagevvashi/59f68735c9377bd0d0e945d7c5a4be70 to your computer and use it in GitHub Desktop.
react-refresh/babel の読み込みスキップ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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