svelte.config.js 739 B

12345678910111213141516171819202122232425262728
  1. import adapter from '@sveltejs/adapter-static';
  2. import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
  3. /** @type {import('@sveltejs/kit').Config} */
  4. const config = {
  5. kit: {
  6. // 使用纯静态适配器,并配置打包文件的输入目录
  7. // Use pure static adapter and configure the input directory of the package file
  8. adapter: adapter({
  9. // may differ from host to host
  10. // 可能因主机而异
  11. fallback: '404.html',
  12. }),
  13. // paths: {
  14. // // @ts-ignore
  15. // base: process.argv.includes('dev') ? '' : process.env.BASE_PATH,
  16. // },
  17. },
  18. onwarn: (warning, handler) => {
  19. if (warning.code.startsWith('a11y-')) {
  20. return;
  21. }
  22. handler(warning);
  23. },
  24. preprocess: vitePreprocess(),
  25. };
  26. export default config;