brainy/web-service-package/rollup.config.js
David Snelling 0c7e999a2f **test(web-service): add cloud storage integration tests and update package settings**
- **Cloud Storage Integration Testing**:
  - Added `cloud-storage.test.ts` to validate cloud storage configurations (AWS S3, Cloudflare R2, Google Cloud Storage) and local storage fallback behavior:
    - Includes tests for environment variable priority and configuration detection.
    - Ensures proper override with `FORCE_LOCAL_STORAGE` when specified.

- **Package Settings Updates**:
  - Introduced `web-service-package/package.json` with configurations for building, running, testing, and deployment:
    - Added NPM scripts for building (`npm run build`), development (`npm run dev`), and testing (`npm run test:cloud`).
    - Configured dependencies and devDependencies for web service functionality and cloud integration.

- **Purpose**:
  - This update ensures comprehensive cloud storage testing and provides structured project configurations for seamless development and deployment workflows.
2025-07-22 10:24:01 -07:00

57 lines
1.1 KiB
JavaScript

import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import json from '@rollup/plugin-json'
import terser from '@rollup/plugin-terser'
const isProduction = process.env.NODE_ENV === 'production'
export default {
input: 'src/server.ts',
output: {
file: 'dist/server.js',
format: 'es',
sourcemap: true,
banner: '#!/usr/bin/env node'
},
external: [
// Node.js built-ins
'fs',
'path',
'url',
'crypto',
'os',
'util',
'events',
'stream',
'buffer',
'querystring',
'http',
'https',
'net',
'tls',
'zlib',
// External dependencies that should not be bundled
'express',
'cors',
'helmet',
'compression',
'express-rate-limit',
'express-validator',
'@soulcraft/brainy'
],
plugins: [
resolve({
preferBuiltins: true,
exportConditions: ['node']
}),
commonjs(),
json(),
typescript({
tsconfig: './tsconfig.json',
sourceMap: true,
inlineSources: !isProduction
}),
...(isProduction ? [terser()] : [])
]
}