graphic-pixi/rollup.config.mjs
2023-12-14 13:07:43 +08:00

43 lines
906 B
JavaScript

import typescript from '@rollup/plugin-typescript';
import replace from '@rollup/plugin-replace';
import ts from 'typescript';
/**
* @type {import('rollup').RollupOptions}
*/
const config = {
input: ['src/index.ts'],
output: {
dir: 'lib',
format: 'esm',
},
external: [
'pixi.js',
'pixi-viewport',
'@stomp/stompjs',
'mqtt',
'eventemitter3',
'@pixi/graphics-extras',
],
logLevel: 'debug',
plugins: [
typescript({
declaration: true,
declarationDir: 'lib',
include: ['src/**/*', 'global.d.ts'],
tsconfig: './tsconfig.json',
// transformers: {
// afterDeclarations: [
// (context) =>
// function visitor(node) {
// console.log(node)
// return ts.visitEachChild(node, visitor, context);
// },
// ],
// },
}),
],
};
export default config;