Skip to content

Commit 7626188

Browse files
authored
fix(explorer): Security update for JS dependencies (#954)
1 parent b0055eb commit 7626188

5 files changed

Lines changed: 1540 additions & 864 deletions

File tree

assets/explorer/.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"presets": ["es2015", "stage-0", "react"]
2+
"presets": ["es2015", "stage-0", "react"],
3+
"plugins": ["syntax-dynamic-import"]
34
}

assets/explorer/dist/bundle.min.js

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

assets/explorer/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
},
88
"dependencies": {
99
"graphiql": "^0.11.10",
10-
"graphql": "^0.13.2",
11-
"react": "^16.0.0",
12-
"react-dom": "^16.0.0"
10+
"graphql": "^14.5.8",
11+
"react": "^16.3",
12+
"react-dom": "^16.3"
1313
},
1414
"devDependencies": {
1515
"babel": "^6.23.0",
1616
"babel-core": "^6.26.0",
1717
"babel-eslint": "^8.0.2",
1818
"babel-loader": "^7.1.2",
19+
"babel-plugin-syntax-dynamic-import": "^6.18.0",
1920
"babel-preset-es2015": "^6.24.1",
2021
"babel-preset-react": "^6.24.1",
2122
"babel-preset-stage-0": "^6.24.1",
@@ -24,6 +25,7 @@
2425
"eslint-config-airbnb": "^16.1.0",
2526
"eslint-plugin-import": "^2.8.0",
2627
"rimraf": "^2.6.2",
27-
"webpack": "^3.8.1"
28+
"webpack": "^4.41.2",
29+
"webpack-cli": "^3.3.10"
2830
}
2931
}

assets/explorer/webpack.config.babel.js

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
filename: 'bundle.min.js',
1111
},
1212
resolve: {
13-
extensions: ['.jsx', '.js', '.json'],
13+
extensions: ['.mjs', '.jsx', '.js', '.json'],
1414
modules: [
1515
path.resolve(__dirname, 'node_modules'),
1616
'node_modules',
@@ -26,6 +26,9 @@ module.exports = {
2626
},
2727
],
2828
},
29+
optimization: {
30+
minimize: true
31+
},
2932
plugins: ([
3033
new webpack.DefinePlugin({
3134
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
@@ -34,37 +37,7 @@ module.exports = {
3437
{ from: path.resolve(__dirname, 'node_modules/graphiql/graphiql.css') },
3538
{ from: path.resolve(__dirname, 'src/container.css') },
3639
]),
37-
]).concat(process.env.NODE_ENV === 'production' ? [
38-
new webpack.optimize.UglifyJsPlugin({
39-
output: {
40-
comments: false,
41-
},
42-
compress: {
43-
unsafe_comps: true,
44-
properties: true,
45-
keep_fargs: false,
46-
pure_getters: true,
47-
collapse_vars: true,
48-
unsafe: true,
49-
warnings: false,
50-
screw_ie8: true,
51-
sequences: true,
52-
dead_code: true,
53-
drop_debugger: true,
54-
comparisons: true,
55-
conditionals: true,
56-
evaluate: true,
57-
booleans: true,
58-
loops: true,
59-
unused: true,
60-
hoist_funs: true,
61-
if_return: true,
62-
join_vars: true,
63-
cascade: true,
64-
drop_console: true,
65-
},
66-
}),
67-
] : []),
40+
]),
6841
externals: {
6942
jquery: 'jQuery',
7043
drupal: 'Drupal',

0 commit comments

Comments
 (0)