vite.config.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import react from '@vitejs/plugin-react';
  17. import jotaiDebugLabel from 'jotai/babel/plugin-debug-label';
  18. import jotaiReactRefresh from 'jotai/babel/plugin-react-refresh';
  19. import path from 'path';
  20. import {defineConfig} from 'vite';
  21. import babel from 'vite-plugin-babel';
  22. import relay from 'vite-plugin-relay';
  23. import {stylexPlugin} from 'vite-plugin-stylex-dev';
  24. export default defineConfig({
  25. resolve: {
  26. alias: {
  27. '@': path.resolve(__dirname, './src'),
  28. },
  29. },
  30. plugins: [
  31. react({
  32. babel: {
  33. plugins: [jotaiDebugLabel, jotaiReactRefresh],
  34. },
  35. }),
  36. stylexPlugin(),
  37. relay,
  38. babel(),
  39. ],
  40. worker: {
  41. plugins: () => [relay],
  42. },
  43. });