Files
DeEarthX-CE/backend/rollup.config.js
15736060610 4654f36202
Some checks failed
CI/CD / Code Check (push) Has been cancelled
CI/CD / Build Windows (push) Has been cancelled
项目迁移
2026-03-14 21:11:59 +08:00

46 lines
1.0 KiB
JavaScript

import typescript from '@rollup/plugin-typescript'
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json';
import terser from '@rollup/plugin-terser';
export default {
input: 'src/main.ts',
output: {
file: 'dist/bundle.js',
format: 'cjs',
inlineDynamicImports: true,
sourcemap: false
},
plugins: [
typescript({
tsconfig: './tsconfig.json',
module: 'Node16',
compilerOptions: {
module: 'Node16'
}
}),
resolve({
preferBuiltins: true,
browser: false,
extensions: ['.ts', '.js', '.json'],
dedupe: ['tslib']
}),
commonjs({
transformMixedEsModules: true
}),
json(),
terser({
compress: true,
mangle: false
})
],
onwarn: (warning, warn) => {
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
if (warning.code === 'THIS_IS_UNDEFINED') return;
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') return;
if (warning.code === 'UNRESOLVED_IMPORT') return;
warn(warning);
}
};