Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
IT Security NachrichtenIT Security News Daily Summary 2026-09-23(23.09.2026 um 23:55 Uhr)
IT Security NachrichtenIT Security News Hourly Summary 2026-09-24 00h : 7 posts(24.09.2026 um 00:00 Uhr)
IT NachrichtenWindows-Backup Drive Snapshot ist verkauft(24.09.2026 um 00:01 Uhr)
Apple iOS & macOSHow to Always Show Menu Bar on iPad with iPadOS 27(23.09.2026 um 23:38 Uhr)
IT Security NachrichtenIT Security News Daily Summary 2026-09-23(23.09.2026 um 23:55 Uhr)
IT Security NachrichtenIT Security News Hourly Summary 2026-09-24 00h : 7 posts(24.09.2026 um 00:00 Uhr)
IT NachrichtenWindows-Backup Drive Snapshot ist verkauft(24.09.2026 um 00:01 Uhr)
Apple iOS & macOSHow to Always Show Menu Bar on iPad with iPadOS 27(23.09.2026 um 23:38 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Vite config reuse

Have you ever wondered how big a Vite configuration file can get? What if you have a project with tens of workspaces? If any of the issues sound familiar - read on! There's something cool coming your way! Writing reusable Vite…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Have you ever wondered how big a Vite configuration file can get? What if you have a project with tens of workspaces? If any of the issues sound familiar - read on! There's something cool coming your way!






Writing reusable Vite configurations



As luck would have it, there is a function exported right from the vite package called mergeConfig(). It takes 2 arguments, essentially 2 fragments of Vite configuration and merges them together.



Based on this we can create a base configuration to use for all our projects. For example, I like all my vite-based projects to have eslint enabled. Here's how you would define it:




/**
* @param {import('vite').UserConfig} overrides
*/

export function defineBaseConfig(overrides = {}) {
const config = {
plugins: [
eslint({
lintOnStart: false,
}),
],
}

return mergeConfig(config, overrides)
}






Now, instead of importing defineConfig from vite you would import this function and define all your other configuration options (besides the eslint plugin) as usual.



All things being equal, here is how you could combine multiple functions to essentially build building blocks of configuration:




/**
* @param {import('vite').UserConfig} overrides
*/

export function defineTestConfig(overrides) {
const config = {
test: {
setupFiles: [
'./vitest.setup.js',
],
coverage: {
enabled: true,
reporter: ['text', 'lcov'],
},
},
}

return mergeConfig(config, overrides)
}

/**
* @param {import('vite').UserConfig} overrides
*/

export function defineDefaultConfig(overrides = {}) {
return defineBaseConfig(defineTestConfig(overrides))
}






Now, whenever you need a Vite-based project with eslint and vitest all you need to do is to use the defineDefaultConifg(), create the vitest.setup.js in your main project and your configuration is done.






Ready-made configurations for you to use



I'm a lazy man. Extremely lazy. I hate repeating myself. That's why I created those 4 packages that I can later on use in my projects:



@padcom/vite-config-default - for use in other configurations



@padcom/vite-config-lib - for use in TypeScript libraries



@padcom/vite-config-vue - for use in Vue.js applications



@padcom/vite-config-vue-lib - for use in Vue.js libraries written in TypeScript



They are written in plain JavaScript. You can easily navigate to their implementation in vscode to see what is being configured and how. The main thing that you might find odd is those configurations make use of the contents of your package.json for a lot of things. That's why the first parameter is the package.json imported like so:




import pkg from './package.json' with { type: 'json }






And then if you need a Vue.js library then simply:




import { defineVueLibConfig } from '@padcom/vite-config-vue-lib'
import pkg from './package.json' with { type: 'json' }

export default defineVueLibConfig(pkg)






That's all! Isn't it nice?






So is that really all I need to do?



For Vite - yes. For your library - there is a little bit more to it, and it not because of vite, but because you're doing a library that exports things.



First of all, you need a proper exports definition for your library. The final build will reside in the dist folder and will contain the following files, assuming your project's name property is set to shiny-components:




{
"name": "shiny-components",
"type": "module",
"files": ["dist", "README.md"],
"exports": {
".": {
"require": "./dist/shiny-components.umd.cjs",
"import": "./dist/shiny-components.js",
"types": "./dist/types.d.ts"
},
"./dist/style.css": "./dist/style.css"
},
"dependencies": {
"vue": "^3"
},
"devDependencies": {
"@padcom/vite-config-vue-lib": "^0.2.0",
"typescript": "5.1.6",
"vite": "^5.2.10",
"vitest": "^1.5.2"
}
}






Please note, that each library you want your library to import but not bundle needs to be declared in dependencies. Likewise, if you want your library to bundle another library then put it into devDependencies. That is the reason why the pkg needs to be passed on to defineVueLibConfig()



And that is really all there is to it! Have fun creating your own configurations or using mine. Let me know how it made your projects more maintainable :)



Have a nice day!

IR-PLAYBOOK-VULN-REMEDIATION
MEDIUM
SOC Incident Playbook: Vulnerability Remediation & Verification
1-Click Detection Engineering: Sigma & YARA Rules
SOC Ready
title: Detect Exploitation - Vite config reuse
id: 96f3d3a6-41fe-4141-960b-dc0ba343628f
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Vite config reuse" ascii wide
    condition:
        any of them
}
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Vite config reuse

Thematisch verwandte Begriffe: Vite, config, reuse · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96550 | A vulnerability was found in sfturing hosp_order up to 627f426331da8086c…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick