mirror of
https://github.com/gongxh0901/kunpocc-behaviortree.git
synced 2025-12-26 16:48:56 +00:00
init
This commit is contained in:
86
rollup.config.mjs
Normal file
86
rollup.config.mjs
Normal file
@@ -0,0 +1,86 @@
|
||||
import terser from '@rollup/plugin-terser';
|
||||
import typescript from '@rollup/plugin-typescript';
|
||||
import dts from 'rollup-plugin-dts';
|
||||
|
||||
export default [
|
||||
{
|
||||
// 生成未压缩的 JS 文件
|
||||
input: 'src/kunpocc-behaviortree.ts',
|
||||
external: ['cc', 'fairygui-cc'],
|
||||
output: [
|
||||
{
|
||||
file: 'dist/kunpocc-behaviortree.mjs',
|
||||
format: 'esm',
|
||||
name: 'kunpocc-behaviortree'
|
||||
},
|
||||
{
|
||||
file: 'dist/kunpocc-behaviortree.cjs',
|
||||
format: 'cjs',
|
||||
name: 'kunpocc-behaviortree'
|
||||
}
|
||||
],
|
||||
plugins: [
|
||||
typescript({
|
||||
tsconfig: './tsconfig.json',
|
||||
importHelpers: false,
|
||||
compilerOptions: {
|
||||
target: "es6",
|
||||
module: "es6",
|
||||
experimentalDecorators: true, // 启用ES装饰器。
|
||||
strict: true,
|
||||
strictNullChecks: false,
|
||||
moduleResolution: "Node",
|
||||
skipLibCheck: true,
|
||||
esModuleInterop: true,
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
{
|
||||
// 生成压缩的 JS 文件
|
||||
input: 'src/kunpocc-behaviortree.ts',
|
||||
external: ['cc', 'fairygui-cc'],
|
||||
output: [
|
||||
{
|
||||
file: 'dist/kunpocc-behaviortree.min.mjs',
|
||||
format: 'esm',
|
||||
name: 'kunpocc-behaviortree'
|
||||
},
|
||||
{
|
||||
file: 'dist/kunpocc-behaviortree.min.cjs',
|
||||
format: 'cjs',
|
||||
name: 'kunpocc-behaviortree'
|
||||
}
|
||||
],
|
||||
plugins: [
|
||||
typescript({
|
||||
tsconfig: './tsconfig.json',
|
||||
importHelpers: false,
|
||||
compilerOptions: {
|
||||
target: "es6",
|
||||
module: "es6",
|
||||
experimentalDecorators: true, // 启用ES装饰器。
|
||||
strict: true,
|
||||
strictNullChecks: false,
|
||||
moduleResolution: "Node",
|
||||
skipLibCheck: true,
|
||||
esModuleInterop: true,
|
||||
}
|
||||
}),
|
||||
terser()
|
||||
]
|
||||
},
|
||||
{
|
||||
// 生成声明文件的配置
|
||||
input: 'src/kunpocc-behaviortree.ts',
|
||||
output: {
|
||||
file: 'dist/kunpocc-behaviortree.d.ts',
|
||||
format: 'es'
|
||||
},
|
||||
plugins: [dts({
|
||||
compilerOptions: {
|
||||
stripInternal: true
|
||||
}
|
||||
})]
|
||||
}
|
||||
];
|
||||
Reference in New Issue
Block a user