site: dev with vite, make it work

This commit is contained in:
07akioni 2020-10-26 15:13:05 +08:00
parent 6453b90043
commit 503405396a
10 changed files with 9 additions and 28 deletions

View File

@ -1,6 +1,6 @@
import { createApp } from 'vue'
import { installDemoComponents, i18n } from './init'
import { installDemoComponents } from './init'
// import debugRouteMixin from './routes/debug-route-mixin'
import hljs from './hljs'
import DemoRouterView from './DemoRouterView.vue'
@ -18,7 +18,6 @@ const router = createDemoRouter(app, routes)
app.use(router)
app.use(naive)
app.use(i18n)
installDemoComponents(app)
app.mount('#app')

View File

@ -1,6 +1,6 @@
import { createApp } from 'vue'
import { installDemoComponents, i18n } from './init'
import { installDemoComponents } from './init'
// import debugRouteMixin from './routes/debug-route-mixin'
import hljs from './hljs'
import DemoRouterView from './DemoRouterView.vue'
@ -18,7 +18,6 @@ const router = createDemoRouter(app, routes)
app.use(router)
app.use(naive)
app.use(i18n)
installDemoComponents(app)
app.mount('#app')

View File

@ -1,4 +1,3 @@
import { createI18n } from 'vue-i18n'
import ComponentDemo from './utils/ComponentDemo.vue'
import ComponentDemos from './utils/ComponentDemos.vue'
import ComponentDocumentation from './utils/ComponentDocumentation.vue'
@ -15,6 +14,3 @@ export function installDemoComponents (app) {
app.component('EditOnGithubButton', EditOnGithubButton)
app.component('EditOnGithubHeader', EditOnGithubHeader)
}
export const i18n = createI18n({
locale: 'zh-CN'
})

View File

@ -114,7 +114,7 @@
"terser": "^4.6.3",
"tinycolor2": "^1.4.2",
"url-loader": "^1.1.2",
"vite": "^1.0.0-rc.4",
"vite": "^1.0.0-rc.6",
"vue-jest": "^4.0.0-rc.0",
"vue-loader": "^16.0.0-beta.8",
"vue-router": "^4.0.0-beta.13",
@ -134,8 +134,7 @@
"treemate": "^0.1.6",
"vooks": "0.0.1-alpha.1",
"vue": "^3.0.2",
"vue-i18n": "^9.0.0-beta.6",
"vue-runtime-helpers": "^1.1.2",
"vueuc": "0.1.0-alpha.3"
}
}
}

View File

@ -7,4 +7,4 @@ export { default as WarningIcon } from './Warning.vue'
export { default as InfoIcon } from './Info.vue'
export { default as CloseIcon } from './Close.vue'
export { default as FilterIcon } from './Filter.vue'
export { default as ArrowDownIcon } from './ArrowDown'
export { default as ArrowDownIcon } from './ArrowDown.vue'

View File

@ -1,5 +1,5 @@
import { h, markRaw } from 'vue'
import intersection from 'lodash-es/intersection'
import { intersection } from 'lodash-es'
import {
configurable,
themeable,

View File

@ -73,7 +73,7 @@ import { setCheckStatusOfRow, createRowKey } from './utils'
import BaseTable from './BaseTable.vue'
import NEmpty from '../../empty'
import NPagination from '../../pagination'
import isPlainObject from 'lodash-es/isPlainObject'
import { isPlainObject } from 'lodash-es'
import styles from './styles'
import { warn, call, formatLength, nextFrame } from '../../_utils'

View File

@ -179,7 +179,7 @@ import {
isValid
} from 'date-fns'
import { strictParse, getDerivedTimeFromKeyboardEvent } from '../../_utils/component/datePicker'
import isEqual from 'lodash-es/isEqual'
import { isEqual } from 'lodash-es'
import styles from './styles'
import {

View File

@ -90,7 +90,7 @@
<script>
import Schema from 'async-validator'
import get from 'lodash-es/get'
import { get } from 'lodash-es'
import {
configurable,
themeable,

View File

@ -1,16 +1,7 @@
const path = require('path')
const mdPlugin = require('./demo/vite-plugins/mdPlugin')
console.log(path.resolve(__dirname, './src'))
const i18nTransform = ({ code, query }) => {
let resource
resource = JSON.parse(code.trim())
return `
export default Comp => {
Comp.i18n = ${JSON.stringify(resource || {})}
}`.trim()
}
module.exports = {
root: __dirname,
plugins: [ mdPlugin() ],
@ -26,8 +17,5 @@ module.exports = {
define: {
'process.env.NODE_ENV': `'${process.env.NODE_ENV}'`,
'__DEV__': process.env === 'development'
},
vueCustomBlockTransforms: {
i18n: i18nTransform
}
}