代码拉取完成,页面将自动刷新
import { defineConfig } from 'rollup'
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'
// https://www.rollupjs.com/guide/big-list-of-options
const rollupConfig = defineConfig({
input: 'src/index.ts',
output: [
{
file: 'dist/index.js',
format: 'cjs',
exports: 'auto',
sourcemap: true
},
{
file: 'dist/index.esm.js',
format: 'esm',
sourcemap: true
}
],
plugins: [
// 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: ['.js', '.cjs', '.mjs', '.ts', '.cts', '.mts']
})
]
})
export default rollupConfig
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。