🚀 feat: Refactor schema exports and update package version to 0.0.4 (#6455)

This commit is contained in:
Ruben Talstra 2025-03-21 13:20:23 +01:00 committed by GitHub
parent b70d9f1a82
commit c58a9c4f33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 119 additions and 85 deletions

View file

@ -1,25 +1,40 @@
import json from '@rollup/plugin-json';
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
export default {
input: 'src/index.ts',
output: [
{
file: 'dist/index.cjs', // Changed from index.js to index.cjs
format: 'cjs',
file: 'dist/index.es.js',
format: 'es',
sourcemap: true,
exports: 'named',
},
{
file: 'dist/index.es.js',
format: 'esm',
file: 'dist/index.cjs',
format: 'cjs',
sourcemap: true,
exports: 'named',
},
],
plugins: [json(), commonjs(), typescript({ tsconfig: './tsconfig.json' })],
external: [
// list your external dependencies
plugins: [
// Allow importing JSON files
json(),
// Automatically externalize peer dependencies
peerDepsExternal(),
// Resolve modules from node_modules
nodeResolve(),
// Convert CommonJS modules to ES6
commonjs(),
// Compile TypeScript files and generate type declarations
typescript({
tsconfig: './tsconfig.json',
declaration: true,
declarationDir: 'dist/types',
rootDir: 'src',
}),
],
// Do not bundle these external dependencies
external: ['mongoose'],
};