babel-plugin-r-sugar
Version:
A Babel plugin that adds Vue-style v-if directive support to React
32 lines (31 loc) • 692 B
JavaScript
import { babel } from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
export default {
input: 'src/index.ts',
output: [
{
file: 'dist/index.js',
format: 'commonjs',
exports: 'default'
},
{
file: 'dist/index.esm.js',
format: 'esm'
}
],
plugins: [
nodeResolve(),
commonjs(),
typescript({
tsconfig: './tsconfig.json',
module: 'esnext' // 添加这一行
}),
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**'
})
],
external: ['@babel/core']
};