Last active
April 27, 2023 18:12
-
-
Save epreston/6edeed20bbf57e59d8492eba673b3478 to your computer and use it in GitHub Desktop.
vite.config.js - example combo vite / vitest config, enforcing modern build target, test setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vite.config.js | |
// import types for vitest config autocomplete | |
/// <reference types="vitest" /> | |
import { defineConfig } from 'vite'; | |
export default defineConfig({ | |
// assetsInclude: ['**/*.gltf', '**/*.glb', '**/*.m4a'], // additional asset types | |
// define: { | |
// // ensure inline tests are removed in production builds | |
// 'import.meta.vitest': 'undefined', | |
// }, | |
// server: { | |
// open: '/index.html', | |
// }, | |
// plugins: [vue(), splitVendorChunkPlugin()], | |
build: { | |
target: ['es2022', 'edge111', 'firefox111', 'chrome111', 'safari16.3', 'ios16.3'], | |
}, | |
test: { | |
// disable threads on GH actions to speed it up | |
threads: !process.env.GITHUB_ACTIONS, | |
setupFiles: ['./test/setup.js'], | |
// includeSource: ['src/**/*.{js,ts}'], // enable inline tests | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment