Skip to content

Commit 98a0b4d

Browse files
klausifubhy
authored andcommitted
fix(voyager): Update babel to get rid of mem package security warning (#937)
1 parent cdc7096 commit 98a0b4d

5 files changed

Lines changed: 871 additions & 440 deletions

File tree

assets/voyager/.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/voyager/dist/bundle.min.js

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

assets/voyager/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"lint": "eslint src"
77
},
88
"dependencies": {
9-
"graphql": "^0.13.2",
9+
"graphql": "^14.5.8",
1010
"graphql-voyager": "^1.0.0-rc.27",
1111
"react": "^16.3",
1212
"react-dom": "^16.3"
@@ -16,6 +16,7 @@
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/voyager/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),
@@ -35,37 +38,7 @@ module.exports = {
3538
{ from: path.resolve(__dirname, 'node_modules/graphql-voyager/dist/voyager.css') },
3639
{ from: path.resolve(__dirname, 'src/container.css') },
3740
]),
38-
]).concat(process.env.NODE_ENV === 'production' ? [
39-
new webpack.optimize.UglifyJsPlugin({
40-
output: {
41-
comments: false,
42-
},
43-
compress: {
44-
unsafe_comps: true,
45-
properties: true,
46-
keep_fargs: false,
47-
pure_getters: true,
48-
collapse_vars: true,
49-
unsafe: true,
50-
warnings: false,
51-
screw_ie8: true,
52-
sequences: true,
53-
dead_code: true,
54-
drop_debugger: true,
55-
comparisons: true,
56-
conditionals: true,
57-
evaluate: true,
58-
booleans: true,
59-
loops: true,
60-
unused: true,
61-
hoist_funs: true,
62-
if_return: true,
63-
join_vars: true,
64-
cascade: true,
65-
drop_console: true,
66-
},
67-
}),
68-
] : []),
41+
]),
6942
externals: {
7043
jquery: 'jQuery',
7144
drupal: 'Drupal',

0 commit comments

Comments
 (0)