Browse Source

chore: update package

pull/4001/head
tangjinzhou 4 years ago
parent
commit
ea8c694cb1
  1. 30
      antd-tools/getWebpackConfig.js
  2. 6
      antd-tools/postcssConfig.js
  3. 7
      antd-tools/transformLess.js
  4. 10
      components/table/index.tsx
  5. 33
      package.json
  6. 2
      v2-doc

30
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,
},
};
};
},
],
};

6
antd-tools/postcssConfig.js

@ -1,6 +0,0 @@
const rucksack = require('rucksack-css');
const autoprefixer = require('autoprefixer');
module.exports = {
plugins: [rucksack(), autoprefixer()],
};

7
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;
});

10
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) {

33
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",

2
v2-doc

@ -1 +1 @@
Subproject commit 3dc171c68957861f7c14de006a7effc328111a94
Subproject commit 31d85319dcc0438b3c80957c99f57b931b047c11
Loading…
Cancel
Save