element-plus/build/rollup.config.bundle.js

49 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-10-29 16:13:29 +08:00
// import vue from 'rollup-plugin-vue'
import typescript from 'rollup-plugin-typescript2'
import css from 'rollup-plugin-css-only'
import { nodeResolve } from '@rollup/plugin-node-resolve'
2020-10-29 16:13:29 +08:00
// import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import path from 'path'
2020-10-29 16:13:29 +08:00
import pkg from '../package.json'
// eslint-disable-next-line @typescript-eslint/no-var-requires
const vue = require('./plugin.js')
export default [
{
input: path.resolve(__dirname, '../packages/element-plus/index.ts'),
output: {
format: 'es',
file: 'lib/index.esm.js',
},
plugins: [
terser(),
nodeResolve(),
2020-10-29 16:13:29 +08:00
// commonjs(),
css(),
vue({
target: 'browser',
css: false,
exposeFilename: false,
}),
2020-10-29 16:13:29 +08:00
typescript({
tsconfigOverride: {
'include': [
'packages/**/*',
],
2020-10-29 16:13:29 +08:00
'exclude': [
'node_modules',
'packages/**/__tests__/*',
2020-10-29 16:13:29 +08:00
],
},
abortOnError: false,
}),
],
2020-10-29 16:13:29 +08:00
external(id) {
return /^vue/.test(id)
|| Object.keys(pkg.dependencies).some(k => new RegExp('^' + k).test(id))
},
},
]