Skip to content

Commit 77a6667

Browse files
committed
fix: closes #925
1 parent a983a92 commit 77a6667

File tree

13 files changed

+89
-100
lines changed

13 files changed

+89
-100
lines changed

build/site/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
</head>
99
<body>
10-
<div id="app" />
10+
<div id="app"></div>
1111
</body>
1212
</html>

build/site/webpack.config.js

+32-46
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const path = require('path');
22
const webpack = require('webpack');
33
const HtmlWebpackPlugin = require('html-webpack-plugin');
4-
const ExtractTextPlugin = require('extract-text-webpack-plugin');
4+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
55

66
const basePath = path.resolve(__dirname, '../../');
77

@@ -14,8 +14,11 @@ module.exports = {
1414
chunkFilename: '[chunkhash:12].js',
1515
filename: '[chunkhash:12].js'
1616
},
17+
optimization: {
18+
minimize: true
19+
},
1720
plugins: [
18-
new ExtractTextPlugin({
21+
new MiniCssExtractPlugin({
1922
filename: '[chunkhash:12].css'
2023
}),
2124
new HtmlWebpackPlugin({
@@ -24,53 +27,36 @@ module.exports = {
2427
})
2528
].concat(process.env.TRAVIS_CI ? [] : [
2629
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') }),
27-
new webpack.optimize.ModuleConcatenationPlugin(),
28-
new webpack.optimize.UglifyJsPlugin({
29-
mangle: {
30-
keep_fnames: true
31-
},
32-
output: {
33-
comments: false
34-
}
35-
})
30+
new webpack.optimize.ModuleConcatenationPlugin()
3631
]),
3732
resolve: {
3833
extensions: ['.js', '.jsx']
3934
},
4035
module: {
41-
rules: [
42-
{
43-
test: /\.jsx?$/,
44-
loader: 'babel-loader',
45-
include: [
46-
path.join(basePath, 'site'),
47-
path.join(basePath, 'src'),
48-
path.join(basePath, 'libs')
49-
]
50-
},
51-
{
52-
test: /\.css$/,
53-
loader: ExtractTextPlugin.extract({
54-
fallback: 'style-loader',
55-
use: 'css-loader'
56-
})
57-
},
58-
{
59-
test: /\.scss$/,
60-
use: ['style-loader', 'css-loader', 'sass-loader']
61-
},
62-
{
63-
test: /\.(ttf|eot|svg|woff|woff2)(\?.+)?$/,
64-
loader: 'file-loader?name=[hash:12].[ext]'
65-
},
66-
{
67-
test: /\.(jpe?g|png|gif)(\?.+)?$/,
68-
loader: 'url-loader?name=[hash:12].[ext]&limit=25000'
69-
},
70-
{
71-
test: /\.md$/,
72-
loader : 'raw-loader'
73-
}
74-
]
75-
}
36+
rules: [{
37+
test: /\.jsx?$/,
38+
loader: 'babel-loader',
39+
include: [
40+
path.join(basePath, 'site'),
41+
path.join(basePath, 'src'),
42+
path.join(basePath, 'libs')
43+
]
44+
}, {
45+
test: /\.css$/,
46+
use: [MiniCssExtractPlugin.loader, "css-loader"]
47+
}, {
48+
test: /\.scss$/,
49+
use: ['style-loader', 'css-loader', 'sass-loader']
50+
}, {
51+
test: /\.(ttf|eot|svg|woff|woff2)(\?.+)?$/,
52+
loader: 'file-loader?name=[hash:12].[ext]'
53+
}, {
54+
test: /\.(jpe?g|png|gif)(\?.+)?$/,
55+
loader: 'url-loader?name=[hash:12].[ext]&limit=25000'
56+
}, {
57+
test: /\.md$/,
58+
loader: 'raw-loader'
59+
}]
60+
},
61+
mode: 'production'
7662
};

package.json

+42-40
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "element-react",
3-
"version": "1.4.31",
3+
"version": "1.4.32",
44
"description": "Element UI for React",
55
"private": false,
66
"main": "dist/npm/es5/index.js",
@@ -32,61 +32,63 @@
3232
},
3333
"homepage": "https://github.com/ElemeFE/element-react",
3434
"devDependencies": {
35-
"@types/react": "^16.4.14",
35+
"@types/react": "^16.8.1",
3636
"babel-cli": "^6.26.0",
37-
"babel-eslint": "^7.2.3",
38-
"babel-jest": "^21.2.0",
39-
"babel-loader": "^7.1.2",
37+
"babel-core": "^6.26.3",
38+
"babel-eslint": "^10.0.1",
39+
"babel-jest": "^23.6.0",
40+
"babel-loader": "^7.1.5",
4041
"babel-plugin-transform-runtime": "^6.23.0",
4142
"babel-preset-env": "^1.7.0",
4243
"babel-preset-react": "^6.24.1",
4344
"babel-preset-stage-1": "^6.24.1",
4445
"babel-runtime": "^6.26.0",
4546
"babel-standalone": "^6.26.0",
46-
"codemirror": "^5.37.0",
47-
"core-js": "^2.5.6",
48-
"css-loader": "^0.28.7",
47+
"codemirror": "^5.43.0",
48+
"core-js": "^2.6.3",
49+
"css-loader": "^2.1.0",
4950
"element-theme-default": "^1.4.13",
50-
"enzyme": "^3.2.0",
51-
"enzyme-adapter-react-16": "^1.1.0",
52-
"eslint": "^3.19.0",
53-
"eslint-config-airbnb": "^15.0.1",
54-
"eslint-plugin-flowtype": "^2.46.3",
55-
"eslint-plugin-import": "^2.6.0",
56-
"eslint-plugin-jsx-a11y": "^5.1.0",
57-
"eslint-plugin-react": "^7.8.1",
58-
"extract-text-webpack-plugin": "^3.0.2",
59-
"file-loader": "^1.1.5",
60-
"flow-bin": "^0.51.1",
61-
"html-webpack-plugin": "^2.30.1",
62-
"jest": "^23.6.0",
63-
"marked": "^0.5.1",
64-
"mock-raf": "^1.0.0",
65-
"node-sass": "^4.9.3",
51+
"enzyme": "^3.8.0",
52+
"enzyme-adapter-react-16": "^1.9.0",
53+
"eslint": "^5.13.0",
54+
"eslint-config-airbnb": "^17.1.0",
55+
"eslint-plugin-flowtype": "^3.2.1",
56+
"eslint-plugin-import": "^2.16.0",
57+
"eslint-plugin-jsx-a11y": "^6.2.1",
58+
"eslint-plugin-react": "^7.12.4",
59+
"file-loader": "^3.0.1",
60+
"flow-bin": "^0.92.1",
61+
"html-webpack-plugin": "^3.2.0",
62+
"jest": "^24.0.0",
63+
"marked": "^0.6.0",
64+
"mini-css-extract-plugin": "^0.5.0",
65+
"mock-raf": "^1.0.1",
66+
"node-sass": "^4.11.0",
6667
"prismjs": "^1.15.0",
67-
"raw-loader": "^0.5.1",
68+
"raw-loader": "^1.0.0",
6869
"react": "*",
6970
"react-dom": "*",
70-
"react-hot-loader": "^3.1.3",
71+
"react-hot-loader": "^4.6.5",
7172
"react-scroll-up": "^1.3.3",
72-
"regenerator-runtime": "^0.11.0",
73-
"sass-loader": "^6.0.5",
74-
"sinon": "^4.0.2",
75-
"style-loader": "^0.19.0",
76-
"typescript": "^3.1.1",
77-
"url-loader": "^0.6.2",
78-
"webpack": "^3.12.0",
79-
"webpack-dev-server": "^2.9.4"
73+
"regenerator-runtime": "^0.13.1",
74+
"sass-loader": "^7.1.0",
75+
"sinon": "^7.2.3",
76+
"style-loader": "^0.23.1",
77+
"typescript": "^3.3.1",
78+
"url-loader": "^1.1.2",
79+
"webpack": "^4.29.1",
80+
"webpack-cli": "^3.2.3",
81+
"webpack-dev-server": "^3.1.14"
8082
},
8183
"dependencies": {
82-
"async-validator": "^1.8.5",
84+
"async-validator": "^1.10.1",
8385
"classnames": "^2.2.6",
84-
"popper.js": "^1.14.4",
86+
"popper.js": "^1.14.7",
8587
"prop-types": "^15.6.2",
86-
"raf": "^3.4.0",
87-
"react-click-outside": "^3.0.0",
88-
"react-transition-group": "^2.5.2",
89-
"throttle-debounce": "^1.0.1"
88+
"raf": "^3.4.1",
89+
"react-click-outside": "^3.0.1",
90+
"react-transition-group": "^2.5.3",
91+
"throttle-debounce": "^2.1.0"
9092
},
9193
"peerDependencies": {
9294
"react": "*",

site/run.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ new WebpackDevServer(webpack({
5454
loader : 'raw-loader'
5555
}
5656
]
57-
}
57+
},
58+
mode: 'development'
5859
}), {
5960
publicPath: '/',
6061
hot: true,

src/carousel/Carousel.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* @flow */
22

33
import React from 'react';
4-
import throttle from 'throttle-debounce/throttle';
4+
import { throttle } from 'throttle-debounce';
55
import { Component, PropTypes, Transition, View } from '../../libs';
66
import { addResizeListener, removeResizeListener } from '../../libs/utils/resize-event';
77

@@ -51,7 +51,7 @@ export default class Carousel extends Component {
5151
}
5252

5353
componentDidMount() {
54-
54+
5555

5656
if (this.props.initialIndex < this.state.items.length && this.props.initialIndex >= 0) {
5757
this.setState({
@@ -64,7 +64,7 @@ export default class Carousel extends Component {
6464

6565
componentDidUpdate(props: Object, state: State): void {
6666
addResizeListener(this.refs.root, this.resetItemPosition);
67-
67+
6868
if (state.activeIndex != this.state.activeIndex) {
6969
this.resetItemPosition(state.activeIndex);
7070

src/cascader/Cascader.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import React from 'react';
44
import ReactDOM from 'react-dom';
55
import ClickOutside from 'react-click-outside';
6-
import debounce from 'throttle-debounce/debounce';
6+
import { debounce } from 'throttle-debounce';
77
import Popper from 'popper.js';
88
import { Component, PropTypes, View } from '../../libs';
99

src/date-picker/TimePicker.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@flow
22
import React from 'react';
3-
import debounce from 'throttle-debounce/debounce';
3+
import { debounce } from 'throttle-debounce';
44

55
import { PropTypes } from '../../libs';
66

src/date-picker/TimeRangePicker.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@flow
22
import React from 'react';
3-
import debounce from 'throttle-debounce/debounce';
3+
import { debounce } from 'throttle-debounce';
44
import { PropTypes } from '../../libs';
55

66
import BasePicker from './BasePicker'

src/date-picker/basic/TimeSpinner.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@flow
22
import React from 'react';
3-
import debounce from 'throttle-debounce/debounce';
3+
import { debounce } from 'throttle-debounce';
44

55
import { PropTypes, Component } from '../../../libs';
66
import { getRangeHours } from '../utils';

src/select/Select.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import React from 'react';
44
import ReactDOM from 'react-dom';
55
import ClickOutside from 'react-click-outside';
6-
import debounce from 'throttle-debounce/debounce';
6+
import { debounce } from 'throttle-debounce';
77
import Popper from 'popper.js';
88
import StyleSheet from '../../libs/utils/style';
99
import { Component, PropTypes, Transition, View } from '../../libs';

src/table/TableHeader.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22
import * as React from 'react';
3-
import throttle from 'throttle-debounce/throttle';
3+
import { throttle } from 'throttle-debounce';
44
import { Component, PropTypes } from '../../libs';
55
import Checkbox from '../checkbox';
66
import FilterPannel from './FilterPannel';
@@ -321,4 +321,4 @@ export default class TableHeader extends Component<TableHeaderProps> {
321321
</table>
322322
);
323323
}
324-
}
324+
}

src/table/TableLayout.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22
import * as React from 'react';
3-
import throttle from 'throttle-debounce/throttle';
3+
import { throttle } from 'throttle-debounce';
44
import { Component, PropTypes } from '../../libs';
55
import { addResizeListener, removeResizeListener } from '../../libs/utils/resize-event';
66

src/tree/Node.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* @flow */
22

33
import React from 'react';
4-
import debounce from 'throttle-debounce/debounce';
4+
import { debounce } from 'throttle-debounce';
55

66
import { PropTypes, Component, CollapseTransition } from '../../libs';
77
import { watchPropertyChange, IDGenerator } from '../../libs/utils';

0 commit comments

Comments
 (0)