-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
29 lines (28 loc) · 864 Bytes
/
Copy pathrollup.config.js
File metadata and controls
29 lines (28 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
import { defineConfig } from 'rollup';
export default defineConfig({
input: 'src/index.ts',
output: [
{
dir: 'dist/',
format: 'esm',
sourcemap: true,
entryFileNames: '[name].js'
}
],
external: ['three'],
plugins: [
resolve(),
commonjs(),
typescript({
tsconfig: './tsconfig.json',
declaration: true, // Enable type declaration files
declarationDir: 'dist/types', // Place declaration files in dist/types
outDir: 'dist', // Place all JS files in dist
rootDir: 'src', // Ensure TypeScript files are compiled from src
})
]
});