fix: update babel.config.js

This commit is contained in:
afc163 2019-11-14 22:49:51 +08:00
parent 365f0158d1
commit a47f414eb3
1 changed files with 2 additions and 10 deletions

View File

@ -1,17 +1,9 @@
// @see https://babeljs.io/docs/en/next/config-files#project-wide-configuration
module.exports = (api) => {
api.cache(() => process.env.NODE_ENV);
if(process.env.NODE_ENV === 'site') {
const env = api.cache(() => process.env.NODE_ENV);
if(env === 'site') {
return {
"presets": [
[
"@babel/preset-env",
{
"loose": true,
"modules": false
}
],
'@babel/preset-react',
"babel-preset-gatsby"
],
"plugins": [