Skip to content

Commit

Permalink
fix: suppoer build sourcemap
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Feb 6, 2021
1 parent 91e004e commit 3ba8285
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 77 deletions.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"antfu.iconify",
"mikestead.dotenv",
"bradlc.vscode-tailwindcss",
"heybourn.headwind"
"heybourn.headwind",
"znck.vue-language-features"
]
}
6 changes: 6 additions & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

- 修复菜单在 hmr 时数据被置空
- 修复 Upload 组件 maxNumber 失效问题
- 修复打包 sourcemap 报错

### 🎫 Chores

- 文档更新
- 升级 ant-design-vue 到 2.0.0

## 2.0.0-rc.18 (2021-02-05)

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@iconify/iconify": "^2.0.0-rc.6",
"@vueuse/core": "^4.0.12",
"ant-design-vue": "2.0.0-rc.9",
"ant-design-vue": "2.0.0",
"apexcharts": "^3.24.0",
"axios": "^0.21.1",
"crypto-es": "^1.2.6",
Expand All @@ -46,7 +46,7 @@
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@iconify/json": "^1.1.297",
"@iconify/json": "^1.1.298",
"@ls-lint/ls-lint": "^1.9.2",
"@purge-icons/generated": "^0.6.0",
"@types/echarts": "^4.9.3",
Expand All @@ -56,7 +56,7 @@
"@types/lodash-es": "^4.17.4",
"@types/mockjs": "^1.0.3",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.3.5",
"@types/qrcode": "^1.4.0",
"@types/rollup-plugin-visualizer": "^2.6.0",
"@types/sortablejs": "^1.10.6",
"@types/yargs": "^16.0.0",
Expand All @@ -82,7 +82,7 @@
"fs-extra": "^9.1.0",
"husky": "^4.3.8",
"less": "^4.1.1",
"lint-staged": "^10.5.3",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"rollup-plugin-gzip": "^2.5.0",
Expand All @@ -93,14 +93,14 @@
"stylelint-order": "^4.1.0",
"ts-node": "^9.1.1",
"typescript": "^4.1.3",
"vite": "2.0.0-beta.64",
"vite": "2.0.0-beta.65",
"vite-plugin-html": "^2.0.0",
"vite-plugin-imagemin": "^0.2.2",
"vite-plugin-mock": "2.0.5",
"vite-plugin-mock": "^2.1.0",
"vite-plugin-purge-icons": "^0.6.0",
"vite-plugin-pwa": "^0.4.3",
"vite-plugin-style-import": "^0.6.6",
"vite-plugin-theme": "0.3.8",
"vite-plugin-pwa": "^0.4.4",
"vite-plugin-style-import": "^0.7.0",
"vite-plugin-theme": "^0.4.0",
"vue-eslint-parser": "^7.4.1",
"yargs": "^16.2.0"
},
Expand All @@ -124,6 +124,6 @@
}
},
"engines": {
"node": "^12 || ^14"
"node": "^12 || ^14 || ^15 || ^16"
}
}
11 changes: 6 additions & 5 deletions src/components/Application/src/search/AppSearchFooter.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<template>
<div :class="`${prefixCls}`">
<span :class="`${prefixCls}__item`">
<g-icon icon="ant-design:enter-outlined" />
<Icon icon="ant-design:enter-outlined" />
</span>
<span>{{ t('component.app.toSearch') }}</span>

<span :class="`${prefixCls}__item`">
<g-icon icon="bi:arrow-up" />
<Icon icon="bi:arrow-up" />
</span>
<span :class="`${prefixCls}__item`">
<g-icon icon="bi:arrow-down" />
<Icon icon="bi:arrow-down" />
</span>
<span>{{ t('component.app.toNavigate') }}</span>
<span :class="`${prefixCls}__item`">
<g-icon icon="mdi:keyboard-esc" />
<Icon icon="mdi:keyboard-esc" />
</span>
<span>{{ t('common.closeText') }}</span>
</div>
Expand All @@ -23,9 +23,10 @@
import { useDesign } from '/@/hooks/web/useDesign';
import { useI18n } from '/@/hooks/web/useI18n';
import Icon from '/@/components/Icon';
export default defineComponent({
name: 'AppSearchFooter',
components: {},
components: { Icon },
setup() {
const { prefixCls } = useDesign('app-search-footer');
const { t } = useI18n();
Expand Down
13 changes: 7 additions & 6 deletions src/components/Application/src/search/AppSearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<SearchOutlined />
</template>
</a-input>
<span :class="`${prefixCls}-cancel`" @click="handleClose">{{
t('common.cancelText')
}}</span>
<span :class="`${prefixCls}-cancel`" @click="handleClose">
{{ t('common.cancelText') }}
</span>
</div>

<div :class="`${prefixCls}-not-data`" v-show="getIsNotData">
Expand All @@ -38,13 +38,13 @@
]"
>
<div :class="`${prefixCls}-list__item-icon`">
<g-icon :icon="item.icon || 'mdi:form-select'" :size="20" />
<Icon :icon="item.icon || 'mdi:form-select'" :size="20" />
</div>
<div :class="`${prefixCls}-list__item-text`">
{{ item.name }}
</div>
<div :class="`${prefixCls}-list__item-enter`">
<g-icon icon="ant-design:enter-outlined" :size="20" />
<Icon icon="ant-design:enter-outlined" :size="20" />
</div>
</li>
</ul>
Expand All @@ -66,10 +66,11 @@
import { useAppInject } from '/@/hooks/web/useAppInject';
import clickOutside from '/@/directives/clickOutside';
import { Input } from 'ant-design-vue';
import Icon from '/@/components/Icon';
export default defineComponent({
name: 'AppSearchModal',
components: { SearchOutlined, AppSearchFooter, [Input.name]: Input },
components: { Icon, SearchOutlined, AppSearchFooter, [Input.name]: Input },
directives: {
clickOutside,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Application/src/search/useMenuSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
return ret;
}

function handleMouseenter(e: ChangeEvent) {
function handleMouseenter(e: any) {
const index = e.target.dataset.index;
activeIndex.value = Number(index);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Container/src/LazyContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div key="component" v-if="isInit">
<slot :loading="loading"></slot>
</div>
<div key="skeleton" v-else name="lazy-skeleton">
<div key="skeleton" v-else>
<slot name="skeleton" v-if="$slots.skeleton"></slot>
<Skeleton v-else />
</div>
Expand Down
15 changes: 13 additions & 2 deletions src/components/Container/src/collapse/CollapseContainer.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<template>
<div :class="['p-2', prefixCls]">
<CollapseHeader v-bind="$props" :prefixCls="prefixCls" :show="show" @expand="handleExpand">
<CollapseHeader
v-bind="getBindValues"
:prefixCls="prefixCls"
:show="show"
@expand="handleExpand"
>
<template #title>
<slot name="title"></slot>
</template>
Expand All @@ -23,7 +28,7 @@
<script lang="ts">
import type { PropType } from 'vue';
import { defineComponent, ref } from 'vue';
import { defineComponent, ref, computed } from 'vue';
// component
import { Skeleton } from 'ant-design-vue';
Expand Down Expand Up @@ -78,10 +83,16 @@
useTimeoutFn(triggerWindowResize, 200);
}
}
const getBindValues = computed((): any => {
return props;
});
return {
show,
handleExpand,
prefixCls,
getBindValues,
};
},
});
Expand Down
14 changes: 10 additions & 4 deletions src/components/Container/src/collapse/CollapseHeader.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div :class="`${prefixCls}__header`">
<BasicTitle :helpMessage="$attrs.helpMessage">
<BasicTitle :helpMessage="helpMessage">
<template v-if="$attrs.title">
{{ $attrs.title }}
{{ title }}
</template>
<template v-else>
<slot name="title"></slot>
Expand All @@ -11,18 +11,24 @@

<div :class="`${prefixCls}__action`">
<slot name="action"></slot>
<BasicArrow v-if="$attrs.canExpan" top :expand="$attrs.show" @click="$emit('expand')" />
<BasicArrow v-if="canExpan" top :expand="show" @click="$emit('expand')" />
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { BasicArrow, BasicTitle } from '/@/components/Basic';
import { propTypes } from '/@/utils/propTypes';
export default defineComponent({
components: { BasicArrow, BasicTitle },
inheritAttrs: false,
props: {
prefixCls: String,
prefixCls: propTypes.string,
helpMessage: propTypes.string,
title: propTypes.string,
show: propTypes.bool,
canExpan: propTypes.bool,
},
emits: ['expand'],
});
Expand Down
2 changes: 1 addition & 1 deletion src/logics/mitt/tabChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function listenerLastChangeTab(
immediate = true
) {
mitt.on(key, callback);
immediate && callback(lastChangeTab);
immediate && lastChangeTab && callback(lastChangeTab);
}

export function removeTabChangeListener() {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"lib": ["dom", "esnext"],
"types": ["vite/client"],
"incremental": true,
"noImplicitAny": false,
"skipLibCheck": true,
"paths": {
"/@/*": ["src/*"]
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
},

build: {
// sourcemap: true,
polyfillDynamicImport: VITE_LEGACY,
terserOptions: {
compress: {
Expand All @@ -54,7 +55,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
},
},
brotliSize: false,
chunkSizeWarningLimit: 1000,
chunkSizeWarningLimit: 1200,
},
define: {
__VERSION__: pkg.version,
Expand Down
Loading

0 comments on commit 3ba8285

Please sign in to comment.