2023-05-09 00:22:00 +00:00
|
|
|
import path from 'path';
|
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
import react from '@vitejs/plugin-react';
|
2023-05-10 21:01:32 +00:00
|
|
|
import wasm from 'vite-plugin-wasm';
|
|
|
|
import topLevelAwait from 'vite-plugin-top-level-await';
|
2023-05-07 19:11:16 +00:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2023-05-13 19:03:32 +00:00
|
|
|
server: {
|
|
|
|
fs: {
|
|
|
|
// Note:
|
|
|
|
// This is _insecure_, but is required to get pnpm link to work.
|
|
|
|
// strict: false,
|
|
|
|
|
|
|
|
allow: [
|
|
|
|
'src',
|
|
|
|
'node_modules',
|
|
|
|
|
|
|
|
// Allow pnpm to link.
|
|
|
|
'../libparakeet-js',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2023-05-10 21:01:32 +00:00
|
|
|
base: './',
|
|
|
|
optimizeDeps: {
|
|
|
|
exclude: ['@jixun/libparakeet'],
|
|
|
|
},
|
|
|
|
plugins: [react(), wasm(), topLevelAwait()],
|
2023-05-09 00:22:00 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'~': path.resolve(__dirname, 'src'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|