This commit is contained in:
07akioni 2020-11-11 23:10:58 +08:00
parent 6be5bf0938
commit 672eee1be8
3 changed files with 3 additions and 60 deletions

View File

@ -1,28 +0,0 @@
// index.js
import { createApp } from 'vue'
import {
create,
enUS,
Button,
Input,
buttonLight,
inputLight
} from '../../es'
const app = createApp()
const naive = create({
// install components globally or import it in other component are both ok
components: [
Button,
Input
],
styles: [
buttonLight,
inputLight
],
locales: [
enUS
]
})
app.use(naive)

View File

@ -1,32 +0,0 @@
const { nodeResolve } = require('@rollup/plugin-node-resolve')
function externalValidator (patterns) {
return id => patterns.some(pattern => id.startsWith(pattern))
}
module.exports = {
input: 'playground/tree-shaking-test/index.js',
output: [
{
format: 'esm',
dir: 'dist'
}
],
plugins: [
nodeResolve({
extensions: ['.js']
})
],
external: externalValidator([
'async-validator',
'date-fns',
'lodash-es',
'vue',
'treemate',
'css-render',
'@css-render/plugin-bem',
'vueuc',
'vooks',
'evtd'
])
}

View File

@ -323,6 +323,9 @@
- [x] use-global-style ? 感觉效果不会特别好而且还是很无谓的性能开销
这个问题可以之后再思考,现阶段 vue 的写法还是全局 install
- [x] dynamic-input, no value
- [ ] button, input 的变量名需要修改一下
- [x] test rollup treeshaking
- [x] test webpack treeshaking
## Info
https://github.com/vuejs/vue-next/issues/2549