From ea8c694cb10ca824a66a1010ba1dfed7b008a9c3 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sun, 25 Apr 2021 23:34:42 +0800 Subject: [PATCH] chore: update package --- antd-tools/getWebpackConfig.js | 30 +++++++++++++++++++++++------- antd-tools/postcssConfig.js | 6 ------ antd-tools/transformLess.js | 7 ++----- components/table/index.tsx | 10 ++++++++-- package.json | 33 ++++++++++++++++----------------- v2-doc | 2 +- 6 files changed, 50 insertions(+), 38 deletions(-) delete mode 100644 antd-tools/postcssConfig.js diff --git a/antd-tools/getWebpackConfig.js b/antd-tools/getWebpackConfig.js index e73392192..3ca2b4d8d 100644 --- a/antd-tools/getWebpackConfig.js +++ b/antd-tools/getWebpackConfig.js @@ -4,11 +4,9 @@ const path = require('path'); const webpack = require('webpack'); const WebpackBar = require('webpackbar'); const { merge } = require('webpack-merge'); -const TerserPlugin = require('terser-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); -const postcssConfig = require('./postcssConfig'); const CleanUpStatsPlugin = require('./utils/CleanUpStatsPlugin'); // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; @@ -141,7 +139,12 @@ function getWebpackConfig(modules) { }, { loader: 'postcss-loader', - options: Object.assign({}, postcssConfig, { sourceMap: true }), + options: { + postcssOptions: { + plugins: ['autoprefixer'], + }, + sourceMap: true, + }, }, ], }, @@ -157,7 +160,12 @@ function getWebpackConfig(modules) { }, { loader: 'postcss-loader', - options: Object.assign({}, postcssConfig, { sourceMap: true }), + options: { + postcssOptions: { + plugins: ['autoprefixer'], + }, + sourceMap: true, + }, }, { loader: 'less-loader', @@ -215,9 +223,17 @@ All rights reserved. config.output.libraryTarget = 'umd'; config.optimization = { minimizer: [ - new TerserPlugin({ - sourceMap: true, - }), + // eslint-disable-next-line no-unused-vars + compiler => { + return () => { + return { + parallel: true, + terserOptions: { + warnings: false, + }, + }; + }; + }, ], }; diff --git a/antd-tools/postcssConfig.js b/antd-tools/postcssConfig.js deleted file mode 100644 index d1aa0db9c..000000000 --- a/antd-tools/postcssConfig.js +++ /dev/null @@ -1,6 +0,0 @@ -const rucksack = require('rucksack-css'); -const autoprefixer = require('autoprefixer'); - -module.exports = { - plugins: [rucksack(), autoprefixer()], -}; diff --git a/antd-tools/transformLess.js b/antd-tools/transformLess.js index be6f1bd81..370ffc17b 100644 --- a/antd-tools/transformLess.js +++ b/antd-tools/transformLess.js @@ -3,7 +3,7 @@ const { readFileSync } = require('fs'); const path = require('path'); const postcss = require('postcss'); const NpmImportPlugin = require('less-plugin-npm-import'); -const postcssConfig = require('./postcssConfig'); +const autoprefixer = require('autoprefixer'); function transformLess(lessFile, config = {}) { const { cwd = process.cwd() } = config; @@ -21,10 +21,7 @@ function transformLess(lessFile, config = {}) { }; return less .render(data, lessOpts) - .then(result => { - const source = result.css; - return postcss(postcssConfig.plugins).process(source, { from: undefined }); - }) + .then(result => postcss([autoprefixer]).process(result.css, { from: undefined })) .then(r => { return r.css; }); diff --git a/components/table/index.tsx b/components/table/index.tsx index db88ac933..21dd7bde3 100644 --- a/components/table/index.tsx +++ b/components/table/index.tsx @@ -2,7 +2,13 @@ import { App, defineComponent, Plugin } from 'vue'; import T, { defaultTableProps } from './Table'; import Column from './Column'; import ColumnGroup from './ColumnGroup'; -import { getOptionProps, getKey, getPropsData, getSlot, flattenChildren } from '../_util/props-util'; +import { + getOptionProps, + getKey, + getPropsData, + getSlot, + flattenChildren, +} from '../_util/props-util'; const Table = defineComponent({ name: 'ATable', @@ -12,7 +18,7 @@ const Table = defineComponent({ props: defaultTableProps, methods: { normalize(elements = []) { - const flattenElements = flattenChildren(elements) + const flattenElements = flattenChildren(elements); const columns = []; flattenElements.forEach(element => { if (!element) { diff --git a/package.json b/package.json index bd51e5c4d..c9244316c 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "pre-publish": "node ./scripts/prepub && npm run generator-webtypes", "prettier": "prettier -c --write '**/*'", "pretty-quick": "pretty-quick", - "dist": "node --max_old_space_size=6144 antd-tools/cli/run.js dist", + "dist": "node --max_old_space_size=8192 antd-tools/cli/run.js dist", "lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue,.ts,.tsx ./components", "lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less", "codecov": "codecov" @@ -81,7 +81,7 @@ "@babel/preset-typescript": "^7.10.4", "@commitlint/cli": "^12.0.0", "@commitlint/config-conventional": "^12.0.0", - "@octokit/rest": "^16.0.0", + "@octokit/rest": "^18.0.0", "@types/fs-extra": "^9.0.8", "@types/lodash-es": "^4.17.3", "@types/raf": "^3.4.0", @@ -94,8 +94,8 @@ "@vue/eslint-config-typescript": "^7.0.0", "@vue/test-utils": "^2.0.0-0", "@webpack-cli/serve": "^1.3.1", - "acorn": "^7.0.0", - "autoprefixer": "^9.6.0", + "acorn": "^8.0.0", + "autoprefixer": "^10.2.0", "axios": "^0.21.0", "babel-eslint": "^10.0.1", "babel-jest": "^26.1.0", @@ -104,25 +104,25 @@ "babel-plugin-inline-import-data-uri": "^1.0.1", "babel-plugin-istanbul": "^6.0.0", "case-sensitive-paths-webpack-plugin": "^2.1.2", - "chalk": "^3.0.0", + "chalk": "^4.1.0", "cheerio": "^1.0.0-rc.2", "codecov": "^3.0.0", "colorful": "^2.1.0", - "commander": "^4.0.0", + "commander": "^7.2.0", "compare-versions": "^3.3.0", "cross-env": "^7.0.0", - "css-loader": "^3.0.0", - "deep-assign": "^2.0.0", + "css-loader": "^5.0.0", + "deep-assign": "^3.0.0", "docsearch.js": "^2.6.3", "enquire-js": "^0.2.1", - "eslint": "^6.8.0", + "eslint": "^7.25.0", "eslint-config-prettier": "^8.0.0", "eslint-plugin-html": "^6.0.0", "eslint-plugin-markdown": "^2.0.0-alpha.0", "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-vue": "^7.1.0", "fetch-jsonp": "^1.1.3", - "fs-extra": "^8.0.0", + "fs-extra": "^9.0.0", "glob": "^7.1.2", "gulp": "^4.0.1", "gulp-babel": "^8.0.0", @@ -140,20 +140,20 @@ "json-templater": "^1.2.0", "jsonp": "^0.2.1", "less": "^4.0.0", - "less-loader": "^7.0.0", + "less-loader": "^8.0.0", "less-plugin-npm-import": "^2.1.0", "less-vars-to-js": "^1.3.0", "lint-staged": "^10.0.0", "marked": "0.3.18", "merge2": "^1.2.1", - "mini-css-extract-plugin": "^0.10.0", + "mini-css-extract-plugin": "^1.5.0", "minimist": "^1.2.0", "mkdirp": "^0.5.1", "mockdate": "^2.0.2", "nprogress": "^0.2.0", "optimize-css-assets-webpack-plugin": "^5.0.1", - "postcss": "^7.0.6", - "postcss-loader": "^3.0.0", + "postcss": "^8.2.12", + "postcss-loader": "^5.0.0", "prettier": "^1.18.2", "pretty-quick": "^2.0.0", "prismjs": "^1.20.0", @@ -164,17 +164,16 @@ "rucksack-css": "^1.0.2", "selenium-server": "^3.0.1", "semver": "^7.0.0", - "style-loader": "^1.0.0", + "style-loader": "^2.0.0", "stylelint": "^13.0.0", "stylelint-config-prettier": "^8.0.0", "stylelint-config-rational-order": "^0.1.2", "stylelint-config-standard": "^22.0.0", "stylelint-declaration-block-no-ignored-properties": "^2.1.0", "stylelint-order": "^4.0.0", - "terser-webpack-plugin": "^3.0.3", "through2": "^3.0.0", "ts-jest": "^26.4.1", - "ts-loader": "^8.1.0", + "ts-loader": "^9.1.0", "typescript": "^4.2.0", "umi-mock-middleware": "^1.0.0", "umi-request": "^1.3.5", diff --git a/v2-doc b/v2-doc index 3dc171c68..31d85319d 160000 --- a/v2-doc +++ b/v2-doc @@ -1 +1 @@ -Subproject commit 3dc171c68957861f7c14de006a7effc328111a94 +Subproject commit 31d85319dcc0438b3c80957c99f57b931b047c11