Skip to content

Commit d1e5c20

Browse files
committed
Upgrade
1 parent 3da7a60 commit d1e5c20

File tree

5 files changed

+5898
-3795
lines changed

5 files changed

+5898
-3795
lines changed

.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"presets": ["react", "es2015", "stage-0"],
3-
"plugins": ["transform-flow-strip-types"]
2+
"presets": ["@babel/preset-env"],
3+
"plugins": [["transform-flow-strip-types"]]
44
}

config/webpack.config.js

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,39 @@
1-
const path = require('path');
2-
const webpack = require('webpack');
3-
const ExtractTextPlugin = require('extract-text-webpack-plugin');
1+
const path = require("path");
2+
const webpack = require("webpack");
3+
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
44

55
module.exports = {
6-
devtool: 'source-map',
7-
entry: [
8-
'./src/library/index.js',
9-
],
6+
devtool: "source-map",
7+
entry: ["./src/library/index.js"],
108
output: {
11-
path: path.join(__dirname, '../dist'),
12-
filename: 'html-to-draftjs.js',
13-
library: 'htmlToDraftjs',
14-
libraryTarget: 'umd',
9+
path: path.join(__dirname, "../dist"),
10+
filename: "html-to-draftjs.js",
11+
library: "htmlToDraftjs",
12+
libraryTarget: "umd"
13+
},
14+
optimization: {
15+
minimizer: [new UglifyJsPlugin()]
1516
},
1617
externals: {
17-
'draft-js': 'draft-js',
18-
immutable: 'immutable',
18+
"draft-js": "draft-js",
19+
immutable: "immutable"
1920
},
2021
plugins: [
2122
new webpack.DefinePlugin({
22-
'process.env': {
23-
NODE_ENV: JSON.stringify('production'),
24-
},
25-
}),
26-
new webpack.optimize.UglifyJsPlugin({
27-
compressor: {
28-
warnings: false,
29-
},
30-
}),
23+
"process.env": {
24+
NODE_ENV: JSON.stringify("production")
25+
}
26+
})
3127
],
3228
module: {
33-
loaders: [
29+
rules: [
3430
{
35-
test: /\.js$/, loader: 'babel-loader',
36-
},
37-
],
31+
test: /\.js$/,
32+
use: [{ loader: "babel-loader" }]
33+
}
34+
]
3835
},
3936
resolve: {
40-
extensions: ['.js', '.json'],
41-
},
37+
extensions: [".js", ".json"]
38+
}
4239
};

dist/html-to-draftjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,36 @@
77
"url": "https://github.com/jpuri/html-to-draftjs.git"
88
},
99
"devDependencies": {
10-
"babel-core": "^6.26.0",
11-
"babel-loader": "^7.1.2",
12-
"babel-preset-env": "^1.6.1",
13-
"babel-preset-es2015": "^6.24.1",
14-
"babel-preset-react": "^6.24.1",
15-
"babel-preset-stage-0": "^6.24.1",
16-
"chai": "^4.1.2",
10+
"@babel/core": "^7.7.4",
11+
"@babel/preset-env": "^7.7.4",
12+
"@babel/preset-react": "^7.7.4",
13+
"@babel/register": "^7.7.4",
14+
"autoprefixer": "^9.7.3",
15+
"babel-eslint": "^10.0.3",
16+
"babel-loader": "^8.0.6",
17+
"babel-plugin-transform-flow-strip-types": "^6.22.0",
18+
"chai": "^4.2.0",
1719
"draft-js": "^0.10.4",
18-
"draftjs-to-html": "^0.7.6",
19-
"react": "^16.2.0",
20-
"react-dom": "^16.2.0",
21-
"react-draft-wysiwyg": "^1.10.12",
22-
"react-scripts": "1.0.17",
23-
"rimraf": "^2.6.2",
24-
"webpack": "^3.9.1"
20+
"draftjs-to-html": "^0.8.4",
21+
"react": "^16.12.0",
22+
"react-dom": "^16.12.0",
23+
"react-draft-wysiwyg": "^1.13.2",
24+
"react-scripts": "3.3.0",
25+
"rimraf": "^3.0.0",
26+
"uglifyjs-webpack-plugin": "^2.2.0",
27+
"webpack": "^4.41.2",
28+
"webpack-cli": "^3.3.10"
2529
},
2630
"peerDependencies": {
27-
"immutable": "3.x.x || 4.x.x",
28-
"draft-js": "^0.10.x"
31+
"draft-js": "^0.11.x",
32+
"immutable": "3.x.x || 4.x.x"
2933
},
3034
"scripts": {
3135
"start": "react-scripts start",
3236
"test": "react-scripts test --env=jsdom",
3337
"eject": "react-scripts eject",
3438
"clean": "rimraf dist",
35-
"build": "npm run clean && webpack --config config/webpack.config.js"
39+
"build": "npm run clean && webpack --mode production --config config/webpack.config.js"
3640
},
3741
"author": "Jyoti Puri",
3842
"license": "MIT"

0 commit comments

Comments
 (0)