Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdullahceylan/gatsby-plugin-remove-console
A plugin that removes all console.* calls from Gatsby's production builds.
https://github.com/abdullahceylan/gatsby-plugin-remove-console
babel babel-plugin console-log gatsby gatsby-plugin remove-console
Last synced: about 2 months ago
JSON representation
A plugin that removes all console.* calls from Gatsby's production builds.
- Host: GitHub
- URL: https://github.com/abdullahceylan/gatsby-plugin-remove-console
- Owner: abdullahceylan
- License: mit
- Created: 2019-02-02T22:12:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-13T09:21:02.000Z (over 3 years ago)
- Last Synced: 2024-11-01T23:04:09.890Z (about 2 months ago)
- Topics: babel, babel-plugin, console-log, gatsby, gatsby-plugin, remove-console
- Language: JavaScript
- Homepage: https://www.gatsbyjs.org/packages/gatsby-plugin-remove-console
- Size: 6.84 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# gatsby-plugin-remove-console
[![NPM](https://img.shields.io/npm/v/gatsby-plugin-remove-console.svg?colorB=brightgreen)](https://www.npmjs.com/package/gatsby-plugin-remove-console) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
![npm](https://img.shields.io/npm/dw/gatsby-plugin-remove-console.svg?colorB=brightgreen)A plugin that adds support to remove all `console.*` calls from Gatsby's production builds using `babel-plugin-transform-remove-console`.
## Example
**In**
```javascript
console.log('foo');
console.error('bar');
```**Out**
```javascript
```## Getting started
### Install the plugin
```sh
npm install gatsby-plugin-remove-console && npm install babel-plugin-transform-remove-console --save-dev
```or
```sh
yarn add gatsby-plugin-remove-console && yarn add babel-plugin-transform-remove-console --dev
```### Usage
Specify the plugin in your `gatsby-config.js`. Here's an example:```javascript
// without options
module.exports = {
plugins: [
'gatsby-plugin-remove-console'
],
};
``````javascript
// with options
module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-remove-console',
options: {
exclude: ['error', 'warn'], // <- will be removed all console calls except these
}
}
]
};
```### Options
`exclude` - An array of console methods to exclude from removal.
# License
MIT, see [LICENSE.md](https://github.com/abdullahceylan/gatsby-plugin-remove-console/blob/master/LICENSE) for details.
# Changelog
See [CHANGELOG.md](https://github.com/abdullahceylan/gatsby-plugin-remove-console/blob/master/CHANGELOG.md) for details.