mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
436fe8c072
to keep spaces inside changelog https://github.com/vuejs/vue/issues/9208
54 lines
1.0 KiB
JavaScript
54 lines
1.0 KiB
JavaScript
const vue = require('rollup-plugin-vue')
|
|
const resolve = require('@rollup/plugin-node-resolve')
|
|
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: {
|
|
whitespace: 'condense'
|
|
}
|
|
}
|
|
}),
|
|
naiveSCSSVariable(),
|
|
terser({
|
|
mangle: false,
|
|
output: {
|
|
beautify: true,
|
|
indent_level: 2
|
|
}
|
|
})
|
|
],
|
|
external: externalValidator([
|
|
'async-validator',
|
|
'css-render',
|
|
'date-fns',
|
|
'lodash-es',
|
|
'resize-observer-polyfill',
|
|
'vue-runtime-helpers',
|
|
'vue-virtual-scroller',
|
|
'@css-render/plugin-bem'
|
|
])
|
|
}
|