2019-12-30 13:15:14 +08:00
|
|
|
const vue = require('rollup-plugin-vue')
|
|
|
|
const resolve = require('@rollup/plugin-node-resolve')
|
|
|
|
const strip = require('@rollup/plugin-strip')
|
|
|
|
const path = require('path')
|
|
|
|
const { terser } = require('rollup-plugin-terser')
|
2020-01-13 14:26:14 +08:00
|
|
|
const naiveSCSSVariable = require('./playground/naiveScssVarPlugin')
|
2019-12-30 13:15:14 +08:00
|
|
|
|
|
|
|
module.exports = {
|
2020-01-13 14:26:14 +08:00
|
|
|
preserveModules: true,
|
|
|
|
input: 'index.js',
|
2019-12-30 13:15:14 +08:00
|
|
|
output: {
|
|
|
|
format: 'esm',
|
2020-01-13 14:26:14 +08:00
|
|
|
dir: 'test-bundle'
|
2019-12-30 13:15:14 +08:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
vue(),
|
2020-01-13 14:26:14 +08:00
|
|
|
naiveSCSSVariable(),
|
2019-12-30 13:15:14 +08:00
|
|
|
strip(),
|
|
|
|
resolve({
|
2020-01-13 14:26:14 +08:00
|
|
|
extensions: ['.js', '.json', '.vue'],
|
2019-12-30 13:15:14 +08:00
|
|
|
jail: path.resolve(__dirname, 'packages')
|
|
|
|
}),
|
|
|
|
terser({
|
|
|
|
mangle: false,
|
|
|
|
output: {
|
|
|
|
beautify: true,
|
|
|
|
indent_level: 2
|
|
|
|
}
|
|
|
|
})
|
|
|
|
],
|
|
|
|
external: [
|
|
|
|
'vue-runtime-helpers',
|
|
|
|
'lodash-es/cloneDeep',
|
|
|
|
'resize-observer-polyfill'
|
|
|
|
]
|
|
|
|
}
|