vite.config.js 602 B

123456789101112131415161718192021222324
  1. import { defineConfig } from 'vite'
  2. export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
  3. return {
  4. root: './',
  5. publicDir: './assets/',
  6. base: './',
  7. server:
  8. {
  9. host: true, // Open to local network and display URL
  10. open: !('SANDBOX_URL' in process.env || 'CODESANDBOX_HOST' in process.env) // Open if it's not a CodeSandbox
  11. },
  12. build:
  13. {
  14. outDir: './dist', // Output in the dist/ folder
  15. emptyOutDir: true, // Empty the folder first
  16. sourcemap: true // Add sourcemap
  17. },
  18. plugins:
  19. [
  20. ]
  21. }
  22. })