Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit ea73378

Browse files
committed
update depts, actualize webpack config
1 parent 2647a52 commit ea73378

File tree

4 files changed

+6744
-45
lines changed

4 files changed

+6744
-45
lines changed

package.json

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,33 @@
1414
},
1515
"main": "reactjsAdminlte.js",
1616
"dependencies": {
17-
"jquery": "^3.1.1",
18-
"react": "^15.6.1",
19-
"react-dom": "^15.6.1"
20-
},
21-
"devDependencies": {
22-
"babel-core": "~6.5.1",
23-
"babel-loader": "~6.2.2",
24-
"babel-preset-es2015": "~6.5.0",
25-
"babel-preset-react": "~6.5.0",
17+
"babel-core": "~6.26.0",
18+
"babel-loader": "~7.1.3",
19+
"babel-preset-es2015": "~6.24.1",
20+
"babel-preset-react": "~6.24.1",
2621
"body-parser": "^1.14.0",
2722
"bower": "^1.7.7",
28-
"chai": "^3.5.0",
29-
"consolidate": "^0.13.1",
30-
"css-loader": "^0.23.1",
31-
"expect": "^1.20.2",
32-
"express": "^4.13.3",
23+
"consolidate": "^0.15.0",
24+
"express": "^4.16.2",
3325
"handlebars": "^4.0.3",
26+
"jquery": "^3.1.1",
3427
"jsx-loader": "^0.13.2",
35-
"mocha": "^3.1.2",
3628
"raphael": "^2.1.4",
37-
"webpack": "^1.14.0",
38-
"webpack-raphael": "^2.1.4",
39-
"react-hot-loader": "^1.3.1",
40-
"style-loader": "^0.13.0",
29+
"react": "^16.2.0",
30+
"react-dom": "^16.2.0",
4131
"velocity-animate": "^1.4.0",
42-
"webpack-dev-server": "~1.14.1"
32+
"webpack": "^4.0.1",
33+
"webpack-raphael": "^2.1.4"
34+
},
35+
"devDependencies": {
36+
"chai": "^4.1.2",
37+
"css-loader": "^0.28.10",
38+
"expect": "^1.20.2",
39+
"mocha": "^5.0.1",
40+
"react-hot-loader": "^4.0.0",
41+
"style-loader": "^0.20.2",
42+
"webpack-cli": "^2.0.10",
43+
"webpack-dev-server": "~3.1.0"
4344
},
4445
"scripts": {
4546
"dev": "node server.js",

webpack.config.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* @Details Webpack config file for adding new vendors, defining entry points and shimming modules.
44
*/
55
var webpack = require('webpack');
6-
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
76
var path = require("path");
87
//var env = require('yargs').argv.mode;
98

@@ -52,11 +51,6 @@ var config = {
5251
'NODE_ENV': JSON.stringify('development')
5352
}
5453
}),
55-
new webpack.optimize.UglifyJsPlugin({
56-
minimize: true
57-
}),
58-
new webpack.optimize.DedupePlugin(),
59-
new webpack.optimize.OccurenceOrderPlugin()
6054

6155
],
6256
devtool: 'cheap-module-source-map',
@@ -73,26 +67,31 @@ var config = {
7367
output: {
7468
path: path.join(__dirname, "public"),
7569
filename: "dist/js/[name].bundle.js",
76-
libraryTarget: "umd",
70+
libraryTarget: "commonjs",
7771
umdNamedDefine: true,
7872
},
73+
74+
optimization: {
75+
minimize: true
76+
},
77+
7978
module: {
8079
noParse: [
8180
//new RegExp(node_dir + '/react'),
8281
new RegExp(lib_dir + './react-dom.js')
8382
],
84-
loaders: [
85-
{
83+
rules: [
84+
{
8685
test: /\.jsx?$/,
87-
loaders: ['react-hot'],
86+
loader: require.resolve('react-hot'),
8887
include: path.join(__dirname, 'public'),
8988
exclude: /(node_modules|bower_components)/
90-
9189
},
9290
{
93-
loader: 'babel', //'jsx-loader'
94-
query: {
95-
presets: ['react', 'es2015']
91+
loader: require.resolve('babel-loader'),
92+
options: {
93+
presets: ['react', 'es2015'],
94+
compact: true
9695
},
9796
include: path.join(__dirname, 'src'),
9897
exclude: /(node_modules|bower_components)/

webpack.production.config.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* @Details Webpack config file for adding new vendors, defining entry points and shimming modules.
44
*/
55
var webpack = require('webpack');
6-
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
76
var path = require("path");
87
//var env = require('yargs').argv.mode;
98

@@ -44,11 +43,6 @@ var config = {
4443
'NODE_ENV': JSON.stringify('production')
4544
}
4645
}),
47-
new webpack.optimize.UglifyJsPlugin({
48-
minimize: true
49-
}),
50-
new webpack.optimize.DedupePlugin(),
51-
new webpack.optimize.OccurenceOrderPlugin()
5246

5347
],
5448
devtool: 'cheap-module-source-map',
@@ -59,9 +53,14 @@ var config = {
5953
output: {
6054
path: path.join(__dirname, "./"),
6155
filename: "./[name].js",
62-
libraryTarget: "umd",
56+
libraryTarget: "commonjs",
6357
umdNamedDefine: true,
6458
},
59+
60+
optimization: {
61+
minimize: true
62+
},
63+
6564
externals: [
6665
{
6766
'react': 'react',
@@ -74,11 +73,12 @@ var config = {
7473
}
7574
],
7675
module: {
77-
loaders: [
76+
rules: [
7877
{
79-
loader: 'babel', //'jsx-loader'
80-
query: {
81-
presets: ['react', 'es2015']
78+
loader: require.resolve('babel-loader'),
79+
options: {
80+
presets: ['react', 'es2015'],
81+
compact: true
8282
},
8383
include: path.join(__dirname, 'src'),
8484
exclude: /(node_modules|bower_components)/

0 commit comments

Comments
 (0)