2020-10-29 16:13:29 +08:00
|
|
|
// import vue from 'rollup-plugin-vue'
|
2020-10-20 11:45:44 +08:00
|
|
|
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
2020-11-02 19:04:54 +08:00
|
|
|
import path from 'path'
|
|
|
|
import css from 'rollup-plugin-css-only'
|
2020-10-29 16:13:29 +08:00
|
|
|
// import commonjs from '@rollup/plugin-commonjs'
|
2020-10-20 11:45:44 +08:00
|
|
|
import { terser } from 'rollup-plugin-terser'
|
2020-11-02 19:04:54 +08:00
|
|
|
import typescript from 'rollup-plugin-typescript2'
|
2020-10-29 16:13:29 +08:00
|
|
|
import pkg from '../package.json'
|
2020-11-04 11:24:36 +08:00
|
|
|
const deps = Object.keys(pkg.dependencies)
|
2020-10-29 16:13:29 +08:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
const vue = require('./plugin.js')
|
2020-10-20 11:45:44 +08:00
|
|
|
|
|
|
|
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(),
|
2020-10-20 11:45:44 +08:00
|
|
|
css(),
|
|
|
|
vue({
|
|
|
|
target: 'browser',
|
|
|
|
css: false,
|
|
|
|
exposeFilename: false,
|
|
|
|
}),
|
2020-10-29 16:13:29 +08:00
|
|
|
typescript({
|
|
|
|
tsconfigOverride: {
|
2020-10-30 23:26:57 +08:00
|
|
|
'include': [
|
|
|
|
'packages/**/*',
|
2020-11-02 19:04:54 +08:00
|
|
|
'typings/vue-shim.d.ts',
|
2020-10-30 23:26:57 +08:00
|
|
|
],
|
2020-10-29 16:13:29 +08:00
|
|
|
'exclude': [
|
|
|
|
'node_modules',
|
2020-10-30 23:26:57 +08:00
|
|
|
'packages/**/__tests__/*',
|
2020-10-29 16:13:29 +08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
abortOnError: false,
|
|
|
|
}),
|
2020-10-20 11:45:44 +08:00
|
|
|
],
|
2020-10-29 16:13:29 +08:00
|
|
|
external(id) {
|
|
|
|
return /^vue/.test(id)
|
2020-11-04 11:24:36 +08:00
|
|
|
|| deps.some(k => new RegExp('^' + k).test(id))
|
2020-10-29 16:13:29 +08:00
|
|
|
},
|
2020-10-20 11:45:44 +08:00
|
|
|
},
|
|
|
|
]
|