Repository: ollama
Issue: Ollama: running Vite in production mode fails
Labels: bug,js

### What is the issue?

Im developing web app for educational purpose. I use React + Vite. Till now in development mode im not facing great problems.... But now i have tried to run in production mode and got the error below: h

```
vite v5.2.10 building for production...
[plugin:vite:resolve] [plugin vite:resolve] Module "fs" has been externalized for browser compatibility, imported by "/home/eduardo/Descargas/workshop-react/node_modules/ollama/dist/index.mjs". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
[plugin:vite:resolve] [plugin vite:resolve] Module "path" has been externalized for browser compatibility, imported by "/home/eduardo/Descargas/workshop-react/node_modules/ollama/dist/index.mjs". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
[plugin:vite:resolve] [plugin vite:resolve] Module "crypto" has been externalized for browser compatibility, imported by "/home/eduardo/Descargas/workshop-react/node_modules/ollama/dist/index.mjs". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
[plugin:vite:resolve] [plugin vite:resolve] Module "os" has been externalized for browser compatibility, imported by "/home/eduardo/Descargas/workshop-react/node_modules/ollama/dist/index.mjs". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
✓ 1052 modules transformed.
x Build failed in 1.49s
error during build:
RollupError: node_modules/ollama/dist/index.mjs (2:13): "promises" is not exported by "__vite-browser-external", imported by "node_modules/ollama/dist/index.mjs".
file: /home/eduardo/Descargas/workshop-react/node_modules/ollama/dist/index.mjs:2:13
1: import { O as Ollama$1, h as head, p as post } from './shared/ollama.14e58652.mjs';
2: import fs, { promises, createReadStream } from 'fs';
                ^
3: import { resolve, join, dirname } from 'path';
4: import { createHash } from 'crypto';
    at getRollupError (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/parseAst.js:394:41)
    at error (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/parseAst.js:390:42)
    at Module.error (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:13860:16)
    at Module.traceVariable (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:14308:29)
    at ModuleScope.findVariable (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:11989:39)
    at ChildScope.findVariable (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7432:38)
    at ClassBodyScope.findVariable (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7432:38)
    at ChildScope.findVariable (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7432:38)
    at ChildScope.findVariable (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7432:38)
    at FunctionScope.findVariable (file:///home/eduardo/Descargas/workshop-react/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7432:38)
```
As for Vite is a problem that should be fixed by ollama ( the library) :https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility


Just if not clear: npm run dev works, but when i tried npm run build....i got the error above.

Hope this could be fixed soon.


Thanks


### OS

_No response_

### GPU

_No response_

### CPU

_No response_

### Ollama version

0.1.37