mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
eeb0a66ba8
Nor some components's space will pass to chilren's slots, which will cause some bugs. For example, confirm in modal accept whitespace from modal and its default slot content is shadowed.
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
const vue = require('rollup-plugin-vue')
|
|
const resolve = require('@rollup/plugin-node-resolve')
|
|
const strip = require('@rollup/plugin-strip')
|
|
const { terser } = require('rollup-plugin-terser')
|
|
const naiveSCSSVariable = require('./build/naiveSCSSVarPlugin')
|
|
|
|
function externalValidator (patterns) {
|
|
return id => patterns.some(pattern => id.startsWith(pattern))
|
|
}
|
|
|
|
module.exports = {
|
|
preserveModules: true,
|
|
input: 'src/index.js',
|
|
output: [
|
|
{
|
|
format: 'cjs',
|
|
dir: 'lib'
|
|
},
|
|
{
|
|
format: 'esm',
|
|
dir: 'es'
|
|
}
|
|
],
|
|
plugins: [
|
|
resolve({
|
|
extensions: ['.js', '.json', '.vue']
|
|
}),
|
|
vue({
|
|
template: {
|
|
compilerOptions: {
|
|
preserveWhitespace: false
|
|
}
|
|
}
|
|
}),
|
|
naiveSCSSVariable(),
|
|
strip(),
|
|
terser({
|
|
mangle: false,
|
|
output: {
|
|
beautify: true,
|
|
indent_level: 2
|
|
}
|
|
})
|
|
],
|
|
external: externalValidator([
|
|
'vue-runtime-helpers',
|
|
'date-fns',
|
|
'async-validator',
|
|
'vue-virtual-scroller',
|
|
'lodash-es',
|
|
'resize-observer-polyfill'
|
|
])
|
|
}
|