yarn add gatsby-plugin-remove-console && yarn add babel-plugin-transform-remove-console --dev
gatsby-plugin-remove-console
の 反映
gatsby-config.js
に追記
module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-remove-console',
options: {
exclude: ['error', 'warn'], // <- will be removed all console calls except these
}
}
]
}