Vite Svelte plugin to remove console logs in prod.

Overview

vite-plugin-svelte-console-remover

npm npm bundle size GitHub last commit

A Vite plugin that removes all console statements (log, group, dir, error, etc) from Svelte, JS, and TS files during build so they don't leak into production.


What this doesn't do: This does not remove anything from your codebase. Your console.logs will still be there. You'll still see them in development and any other non-production environment.

What this does: Removes all console statements from appearing on your production domain. They're removed during the build/tranform step, so they're stripped out of your production code.

Example Use

import adapter from '@sveltejs/adapter-auto';
import preprocess from 'svelte-preprocess';
import removeConsole from 'vite-plugin-svelte-console-remover';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	preprocess: preprocess(),
	kit: {
		adapter: adapter(),
		vite: {
			plugins: [removeConsole()],
		}
	}
}

export default config;
You might also like...

⚡ī¸đŸŒą Vite plugin for Twig, transforms twig templates into HTML

⚡ī¸ 🌱 ViteTwig import twig from '@vituum/vite-plugin-twig' export default { plugins: [ twig({ reload: true, root: null, filte

Dec 15, 2022

A Vite plugin for projecting your application onto a remote production page during development.

vite-plugin-proxy-page A Vite plugin for developing an SPA in the context of a deployed production page. What's the Problem? It's an increasingly comm

Nov 13, 2022

✅ Vite plugin for validating your environment variables

✅ Vite plugin for validating your environment variables

This Vite plugin allows you to validate your environment variables at build or dev time. This allows your build/dev-server to fail-fast if your setup

Dec 23, 2022

📓 The UI component explorer. Develop, document, & test React, Vue, Angular, Web Components, Ember, Svelte & more!

📓 The UI component explorer. Develop, document, & test React, Vue, Angular, Web Components, Ember, Svelte & more!

Build bulletproof UI components faster Storybook is a development environment for UI components. It allows you to browse a component library, view the

Jan 9, 2023

NativeScript empowers you to access native api's from JavaScript directly. Angular, Vue, Svelte, React and you name it compatible.

NativeScript empowers you to access native api's from JavaScript directly. Angular, Vue, Svelte, React and you name it compatible.

NativeScript empowers you to access native APIs from JavaScript directly. The framework currently provides iOS and Android runtimes for rich mobile de

Jan 4, 2023

tsParticles - Easily create highly customizable particles animations and use them as animated backgrounds for your website. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno.

tsParticles - Easily create highly customizable particles animations and use them as animated backgrounds for your website. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno.

tsParticles - TypeScript Particles A lightweight TypeScript library for creating particles. Dependency free (*) and browser ready! Particles.js conver

Jan 4, 2023

A template to use GoLang Lorca package to make desktop applications using webview and Svelte for the frontend,

Svelte Lorca Template A starter project for building modern cross-platform desktop apps in Go, HTML, and Svelte. This project is a fork of lorca-ts-re

Jun 19, 2022

bare bones demo of svelte-three

create-svelte Everything you need to build a Svelte project, powered by create-svelte; Creating a project If you're seeing this, you've probably alrea

Jul 30, 2022

A svelte action for creating tippy.js tooltips with full typescript support

A svelte action for creating tippy.js tooltips with full typescript support

Tippy.js for svelte A svelte action for creating tippy.js tooltips. Getting started # Pnpm pnpm add svelte-tippy tippy.js # Yarn yarn add svelte-tipp

Jul 19, 2022
Comments
  • Usage note

    Usage note

    I'm sure this wasn't easy to create. And I applaud you for doing so. But I think it might be worth noting in the README the same thing can be accomplished along with dropping debuggers with a few lines of Vite config.

    SvelteKit users:

    kit: {
      adapter: adapter(),
      vite: {
        esbuild: { drop: ['console', 'debugger'] }
      }
    }
    

    I opened this issue in hopes to get this documented and prevent Vite plug-in sprawl in SvelteKit. I hope you will consider documenting this for the benefit of your users and those who are still learning to help them keep their apps as simple as possible.

    opened by vhscom 2
Releases(v1.0.10)
Vite-plugin-web-extension - A vite plugin for generating cross browser platform, ES module based web extensions.

vite-plugin-web-extension A vite plugin for generating cross browser platform, ES module based web extensions. Features Manifest V2 & V3 Support Compl

Ruben Medina 81 Dec 31, 2022
A vite plugin that deletes console.log in the production environment

vite-plugin-remove-console A vite plugin that deletes console.log in the production environment English | 中文 Install npm install vite-plugin-remove-co

啝čŖŗ 49 Dec 22, 2022
A Svelte SPA Template for simple SPA Apps without using svelte kit.

Svelte SPA Template A Svelte Single Page Application Template for simple SPA Apps without using Svelte Kit or Sapper. New Project To create a new proj

ADITYA 1 Jan 24, 2022
Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse

Vite Vue SSR Starter Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse Features ⚡ī¸ Vue 3, Vite 2, TypeScript ?? Domain-Driv

Oleg Koval 10 Aug 2, 2022
A Marko plugin for Vite

@marko/vite A Marko plugin for Vite. Installation npm install @marko/vite Example config import { defineConfig } from "vite"; import marko from "@mark

Marko 49 Nov 26, 2022
A progress bar plugin for Vite.

vite-plugin-progress Display with progress bar when building ?? Install npm i vite-plugin-progress -D # yarn yarn add vite-plugin-progress -D # pn

Jeddy Gong 137 Dec 17, 2022
Laravel plugin for Vite.

Laravel Vite Plugin Introduction Vite is a modern frontend build tool that provides an extremely fast development environment and bundles your code fo

The Laravel Framework 580 Jan 7, 2023
🐝 A vite plugin automatically export files & HMR support

vite-plugin-hot-export Automatically export files with HMR English|įŽ€äŊ“中文 Why ? When developing, we often need to download some images or svg from the i

Frozen FIsh 54 Nov 12, 2022
Vite plugin for minifying / obfuscating CSS classes in production builds

vite-plugin-class-mangler Vite plugin for minifying / obfuscating classes in production builds. Compatible with Tailwind, inline, or imported styles.

Maxim 28 Dec 22, 2022
Rust dbg! in js powered by rollup/vite plugin system

rollup-plugin-dbg This plugin is also compatible with vite use with rollup import { defineConfig } from "rollup"; import config from "./package.json";

Jason 17 Aug 18, 2022