chore: update vite

pull/4606/head
tangjinzhou 2021-09-02 10:39:49 +08:00
parent 4283b88670
commit 9388245462
5 changed files with 27 additions and 12 deletions

View File

@ -68,7 +68,7 @@ Custom sizes to fit in a variety of containers.
<script lang="ts"> <script lang="ts">
import { defineComponent, ref } from 'vue'; import { defineComponent, ref } from 'vue';
// TODO // TODO
import { RadioChangeEvent } from 'ant-design-vue/es/radio/interface'; import type { RadioChangeEvent } from 'ant-design-vue/es/radio/interface';
export default defineComponent({ export default defineComponent({
setup() { setup() {

View File

@ -290,7 +290,7 @@
// Menu // Menu
// --- // ---
// dark theme // dark theme
@menu-dark-submenu-bg: @component-background; @menu-dark-inline-submenu-bg: @component-background;
@menu-dark-bg: @popover-background; @menu-dark-bg: @popover-background;
@menu-popup-bg: @popover-background; @menu-popup-bg: @popover-background;
@ -310,6 +310,7 @@
@table-header-bg: #1d1d1d; @table-header-bg: #1d1d1d;
@table-body-sort-bg: fade(@white, 1%); @table-body-sort-bg: fade(@white, 1%);
@table-row-hover-bg: #262626; @table-row-hover-bg: #262626;
@table-header-cell-split-color: fade(@white, 8%);
@table-header-sort-bg: #262626; @table-header-sort-bg: #262626;
@table-header-filter-active-bg: #434343; @table-header-filter-active-bg: #434343;
@table-header-sort-active-bg: #303030; @table-header-sort-active-bg: #303030;

View File

@ -1,11 +1,13 @@
import less from 'less'; import less from 'less';
// import { getThemeVariables } from 'ant-design-vue/dist/theme'; import defaultVars from '../scripts/default-vars';
import dark from '../scripts/dark-vars';
const themeConfig = [ const themeConfig = [
{ {
theme: 'dark', theme: 'dark',
htmlThemeAttr: 'dark', htmlThemeAttr: 'dark',
modifyVars: { modifyVars: {
// ...getThemeVariables({ dark: true }), ...defaultVars,
...dark,
'text-color': 'fade(@white, 65%)', 'text-color': 'fade(@white, 65%)',
'gray-8': '@text-color', 'gray-8': '@text-color',
'background-color-base': '#555', 'background-color-base': '#555',

View File

@ -3,18 +3,14 @@ import vue from '@vitejs/plugin-vue';
import md from '../plugin/md'; import md from '../plugin/md';
import docs from '../plugin/docs'; import docs from '../plugin/docs';
import vueJsx from '@vitejs/plugin-vue-jsx'; import vueJsx from '@vitejs/plugin-vue-jsx';
// import { getThemeVariables } from 'ant-design-vue/dist/theme'; import { additionalData } from './themeConfig';
// import { additionalData } from './themeConfig';
import defaultVar from '../scripts/default-vars'; import defaultVar from '../scripts/default-vars';
// import compact from '../scripts/compact-vars';
// import dark from '../scripts/dark-vars';
/** /**
* @type {import('vite').UserConfig} * @type {import('vite').UserConfig}
*/ */
export default { export default {
resolve: { resolve: {
alias: { alias: {
// moment: 'moment/dist/moment.js',
'@': path.join(__dirname, './src'), '@': path.join(__dirname, './src'),
vue: 'vue/dist/vue.esm-bundler.js', vue: 'vue/dist/vue.esm-bundler.js',
'ant-design-vue': path.resolve(__dirname, '../components'), 'ant-design-vue': path.resolve(__dirname, '../components'),
@ -23,6 +19,8 @@ export default {
plugins: [ plugins: [
vueJsx({ vueJsx({
// options are passed on to @vue/babel-plugin-jsx // options are passed on to @vue/babel-plugin-jsx
mergeProps: false,
enableObjectSlots: false,
}), }),
docs(), docs(),
md(), md(),
@ -31,7 +29,16 @@ export default {
}), }),
], ],
optimizeDeps: { optimizeDeps: {
include: ['fetch-jsonp', '@ant-design/icons-vue', 'lodash-es'], include: [
'fetch-jsonp',
'@ant-design/icons-vue',
'lodash-es',
'dayjs',
'vue',
'vue-router',
'vue-i18n',
'async-validator',
],
}, },
css: { css: {
preprocessorOptions: { preprocessorOptions: {
@ -39,7 +46,7 @@ export default {
modifyVars: { ...defaultVar }, modifyVars: { ...defaultVar },
javascriptEnabled: true, javascriptEnabled: true,
// includePaths: ["node_modules/"], // includePaths: ["node_modules/"],
// additionalData, additionalData,
}, },
}, },
}, },

View File

@ -1,5 +1,10 @@
{ {
"compilerOptions": { "compilerOptions": {
"baseUrl": "./",
"paths": {
"ant-design-vue": ["components/index.tsx"],
"ant-design-vue/es/*": ["components/*"]
},
"strictNullChecks": false, "strictNullChecks": false,
"moduleResolution": "node", "moduleResolution": "node",
"esModuleInterop": true, "esModuleInterop": true,