Skip to content

Commit

Permalink
배포 시도 (vite config ts)
Browse files Browse the repository at this point in the history
  • Loading branch information
dutexion committed Aug 6, 2024
1 parent 6a42a32 commit b48f330
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
import reactRefresh from '@vitejs/plugin-react-refresh';
import path from 'path';
import { defineConfig } from 'vite';
import fs from 'fs';

// https://vitejs.dev/config/
export default defineConfig({
// This changes the out put dir from dist to build
// comment this out if that isn't relevant for your project
esbuild: {
supported: {
'top-level-await': true,
},
},
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis',
},
plugins: [
{
name: 'ignore-use-client-directive',
setup(build) {
build.onLoad({ filter: /.*/ }, async (args) => {
if (args.path.includes('node_modules/@tanstack/react-query-devtools')) {
return {
contents: (await fs.promises.readFile(args.path, 'utf8')).replace(/'use client';?/g, ''),
};
}
});
},
},
],
},
},
server: {
port: 3002,
},
Expand Down

0 comments on commit b48f330

Please sign in to comment.