Ai
1 Star 0 Fork 1

陶良通/nodepub3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.ts 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
import { defineConfig } from 'rollup'
import progress from 'rollup-plugin-progress2'
import { cleandir } from 'rollup-plugin-cleandir'
import nodeExternals from 'rollup-plugin-node-externals'
import commonjs from '@rollup/plugin-commonjs'
import nodeResolve from '@rollup/plugin-node-resolve'
import typescript from 'rollup-plugin-typescript2'
import bable from '@rollup/plugin-babel'
import { DEFAULT_EXTENSIONS } from '@babel/core'
import dts from 'rollup-plugin-dts'
import del from 'rollup-plugin-delete'
// https://www.rollupjs.com/guide/big-list-of-options
const rollupConfig = defineConfig([
{
input: 'src/index.ts',
output: [
{
file: 'dist/index.cjs',
format: 'cjs',
exports: 'auto'
},
{
file: 'dist/index.mjs',
format: 'esm'
}
],
plugins: [
// https://gitee.com/taolt/rollup-plugin-progress2
progress(),
// https://github.com/mstssk/rollup-plugin-cleandir
cleandir('dist'),
// https://github.com/Septh/rollup-plugin-node-externals
nodeExternals(),
// https://github.com/rollup/plugins/tree/master/packages/commonjs/#readme
commonjs(),
// https://github.com/rollup/plugins/tree/master/packages/node-resolve/#readme
nodeResolve(),
// https://github.com/ezolenko/rollup-plugin-typescript2
typescript({
tsconfigOverride: {
exclude: ['test/**/*']
}
}),
// https://github.com/rollup/plugins/tree/master/packages/babel#readme
bable({
babelHelpers: 'runtime',
exclude: 'node_modules/**',
extensions: [...DEFAULT_EXTENSIONS, '.ts', '.tsx']
})
]
},
{
input: './dist/index.d.ts',
output: [
{
file: './dist/index.d.ts',
format: 'es'
}
],
plugins: [
// github.com/Swatinem/rollup-plugin-dts#readme
dts(),
// github.com/vladshcherbin/rollup-plugin-delete#readme
del({
hook: 'buildEnd',
targets: ['**/*.d.ts', '!**/index.d.ts']
})
]
}
])
export default rollupConfig
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/taolt/nodepub3.git
git@gitee.com:taolt/nodepub3.git
taolt
nodepub3
nodepub3
master

搜索帮助