Skip to content

Commit

Permalink
chore: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Apr 1, 2022
1 parent 41bcd22 commit 0d2b882
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 151 deletions.
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"build:test": "vue-cli-service build --mode test",
"build:preview": "npm run build && npx serve -s dist",
"build:prod": "vue-cli-service build --mode production",
"build:report": "vue-cli-service build --report && npx live-server --open=dist/report.html",
"clean:lib": "npx rimraf node_modules",
"deploy": "npm run build && npx gh-pages -d dist",
"lint": "vue-cli-service lint",
Expand All @@ -29,8 +30,8 @@
},
"dependencies": {
"@ant-design/icons-vue": "^6.1.0",
"@vueuse/core": "^8.2.0",
"ant-design-vue": "3.1.0-rc.2",
"@vueuse/core": "^8.2.3",
"ant-design-vue": "3.1.0-rc.6",
"axios": "^0.26.1",
"core-js": "^3.21.1",
"dayjs": "^1.11.0",
Expand All @@ -39,7 +40,7 @@
"mitt": "^3.0.0",
"mockjs": "^1.1.0",
"nprogress": "^1.0.0-1",
"pinia": "2.0.12",
"pinia": "2.0.13",
"qs": "^6.10.3",
"socket.io-client": "4.4.1",
"sortablejs": "^1.15.0",
Expand All @@ -55,8 +56,8 @@
"@types/lodash-es": "^4.17.6",
"@types/node": "^17.0.23",
"@types/webpack-env": "^1.16.3",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"@vue/cli-plugin-babel": "^5.0.4",
"@vue/cli-plugin-eslint": "^5.0.4",
"@vue/cli-plugin-router": "^5.0.4",
Expand All @@ -65,7 +66,6 @@
"@vue/eslint-config-typescript": "^10.0.0",
"babel-plugin-import": "^1.13.3",
"commitizen": "^4.2.4",
"compression-webpack-plugin": "^9.2.0",
"conventional-changelog-cli": "^2.2.2",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -80,6 +80,7 @@
"postcss-html": "^1.3.0",
"prettier": "^2.6.1",
"regenerator-runtime": "^0.13.9",
"speed-measure-webpack-plugin": "^1.5.0",
"stylelint": "^14.6.1",
"stylelint-config-html": "^1.0.0",
"stylelint-config-prettier": "^9.0.3",
Expand All @@ -88,7 +89,7 @@
"stylelint-order": "^5.0.0",
"svg-sprite-loader": "^6.0.11",
"typescript": "^4.6.3",
"unplugin-vue-define-options": "^0.5.0",
"unplugin-vue-define-options": "^0.6.0",
"vue-cli-plugin-windicss": "^1.1.3",
"vue-eslint-parser": "^8.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/basic/image-preview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface PreviewType extends ImagePreviewType {

export default defineComponent({
props: {
...imageProps,
...imageProps(),
preview: {
type: Object as PropType<PreviewType | boolean>,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/core/schema-form/src/schema-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isObject } from '@/utils/is';
export const aFormPropKeys = Object.keys(formProps);

export const schemaFormProps = {
...formProps,
...formProps(),
layout: {
type: String as PropType<FormProps['layout']>,
default: 'horizontal',
Expand Down
9 changes: 2 additions & 7 deletions src/views/demos/form/basic-form/form-schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,9 @@ export const schemas: FormSchema[] = [
},
{
field: 'field34',
component: ({ formModel, schema, field }) => {
component: ({ schema }) => {
const options = schema.componentProps?.requestResult || [];
return (
<Radio.Group
v-model={[formModel[field], 'value']}
options={options.slice(0, 2)}
></Radio.Group>
);
return <Radio.Group options={options.slice(0, 2)}></Radio.Group>;
},
label: '远程Radio',
helpMessage: ['RadioGroup组件', '使用接口提供的数据生成选项'],
Expand Down
1 change: 1 addition & 0 deletions src/views/demos/form/basic-form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
</div>,
3,
);
console.log('values', values);
}
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Popover placement="bottomLeft" trigger="click">
<Popover placement="bottomLeft" trigger="click" overlay-class-name="__multiple-cascader">
<template #content>
<NodePanel ref="nodePanelRef" :options="myOptions" />
</template>
Expand Down Expand Up @@ -142,6 +142,12 @@
// });
</script>

<style lang="less">
.__multiple-cascader .ant-popover-inner-content {
padding: 8px 0;
}
</style>

<style lang="less" scoped>
.input-box {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
</script>

<style lang="less" scoped>
.ant-cascader-menu:last-of-type {
border-right: 0;
}
.check-row {
@apply flex justify-between items-center relative;
.label {
Expand Down
75 changes: 32 additions & 43 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
const path = require('path');
const { defineConfig } = require('@vue/cli-service');
const webpack = require('webpack');
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
// const CompressionPlugin = require('compression-webpack-plugin');
// 去除console
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
const dayjs = require('dayjs');
const TerserPlugin = require('terser-webpack-plugin');

const resolve = (dir) => path.join(__dirname, dir); // 路径
const pkg = require('./package.json');

process.env.VUE_APP_VERSION = pkg.version;

const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV);
// const IS_DEV = ['development'].includes(process.env.NODE_ENV);
const IS_DEV = ['development'].includes(process.env.NODE_ENV);

// port = 8098 npm run dev OR npm run dev --port = 8098
const port = process.env.port || process.env.npm_config_port || 8098; // dev port
Expand Down Expand Up @@ -53,21 +52,12 @@ module.exports = defineConfig({

config
// https://webpack.js.org/configuration/devtool/#development
.when(!IS_PROD, (config) => config.devtool('cheap-source-map'));
.when(IS_DEV, (config) => config.devtool('cheap-source-map'));

// 配置相关loader,支持修改,添加和替换相关的loader
config.resolve.alias.set('@', resolve('src'));
config.resolve.alias.set('vue-i18n', 'vue-i18n/dist/vue-i18n.cjs.js');

// 打包分析
if (IS_PROD) {
// config.optimization.delete('splitChunks');
// config.plugin('webpack-report').use(BundleAnalyzerPlugin, [
// {
// analyzerMode: 'static',
// },
// ]);
}
config.plugin('html').tap((args) => {
args[0].title = 'vue3-antd-admin管理系统';
return args;
Expand All @@ -91,6 +81,7 @@ module.exports = defineConfig({

// svg rule loader
config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end();

config.module
.rule('icons')
.test(/\.svg$/)
Expand All @@ -102,19 +93,9 @@ module.exports = defineConfig({
symbolId: 'icon-[name]',
});
config.when(IS_PROD, (config) => {
// gzipped
// config.plugin('CompressionPlugin').use(
// new CompressionPlugin({
// algorithm: 'gzip',
// test: /\.(js|css)$/, // 匹配文件名
// threshold: 10240, // 对超过10k的数据压缩
// deleteOriginalAssets: false, // 不删除源文件
// minRatio: 0.8, // 压缩比
// }),
// );
// split
config.optimization.splitChunks({
chunks: 'all',
chunks: 'all', //指定哪些模块需要打包
cacheGroups: {
libs: {
name: 'chunk-libs',
Expand All @@ -130,7 +111,7 @@ module.exports = defineConfig({
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
minChunks: 3, // 被引用3次就提取出来
priority: 5,
reuseExistingChunk: true, // 表示是否使用已有的 chunk,如果为 true 则表示如果当前的 chunk 包含的模块已经被抽取出去了,那么将不会重新生成新的。
},
Expand All @@ -156,39 +137,47 @@ module.exports = defineConfig({
config.resolve.fallback = { path: require.resolve('path-browserify') };
// use defineOptions https://github.com/sxzz/unplugin-vue-define-options
config.plugins.push(require('unplugin-vue-define-options/webpack')());
// 打包速度分析
config.plugins.push(new SpeedMeasurePlugin());

config.plugins.push(
// 定义全局变量
new webpack.DefinePlugin({
__APP_INFO__: JSON.stringify(__APP_INFO__),
}),
);

if (IS_PROD) {
config.plugins.push(
new TerserPlugin({
terserOptions: {
warnings: false,
format: {
comments: false,
},
compress: {
drop_debugger: true, // 注释console
drop_console: true,
pure_funcs: ['console.log'], // 移除console
},
},
extractComments: false, // 是否将注释提取到一个单独的文件中
parallel: true,
}),
// terser-webpack-plugin (https://webpack.docschina.org/plugins/terser-webpack-plugin/);
const TerserPluginIndex = config.optimization.minimizer.findIndex(
(n) => n.__pluginName === 'terser',
);
config.optimization.minimizer[TerserPluginIndex] = new TerserPlugin({
terserOptions: {
warnings: false,
format: {
comments: false,
},
compress: {
drop_debugger: true, // 注释console
drop_console: true,
pure_funcs: ['console.log'], // 移除console
},
},
extractComments: false, // 是否将注释提取到一个单独的文件中
parallel: true, // 是否并⾏打包
});
}
},
devServer: {
port,
client: {
progress: true,
},
// watchOptions: {
// // 开发时,自动保存代码导致构建频繁且会报错,又不想手动保存,则可以开启延迟构建
// aggregateTimeout: 1500,
// ignored: /node_modules/,
// },
proxy: {
// '/mock-api': {
// target: `http://localhost:${port}`,
Expand Down
2 changes: 1 addition & 1 deletion windi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineConfig({
'2xl': '1536px',
},
colors: {
gray: colors.coolGray,
gray: colors.gray,
blue: colors.sky,
red: colors.rose,
pink: colors.fuchsia,
Expand Down
Loading

1 comment on commit 0d2b882

@vercel
Copy link

@vercel vercel bot commented on 0d2b882 Apr 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.