From 362ec92b1e8188d3818e6d804c674476766d24ea Mon Sep 17 00:00:00 2001 From: Caleb Date: Wed, 13 Sep 2017 20:02:22 -0600 Subject: [PATCH] Fix gray-matter build in WebPack. --- webpack.base.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webpack.base.js b/webpack.base.js index 145f37ef1e18..f57235fb697d 100644 --- a/webpack.base.js +++ b/webpack.base.js @@ -10,7 +10,10 @@ module.exports = { { test: /\.js?$/, use: 'babel-loader', - exclude: /node_modules/, + exclude: { + test: /node_modules/, + exclude: /node_modules(?:\/|\\)gray\-matter/, + }, }, { /* CSS loader for npm modules that are shipped with CSS. @@ -66,5 +69,8 @@ module.exports = { fetch: 'imports-loader?this=>global!exports-loader?global.fetch!whatwg-fetch', }), ], + node: { + fs: 'empty', // Provide an empty `fs` module for dependencies that expect one, but don't actually need/use it (i.e. `gray-matter.read`) + }, target: 'web', // Make web variables accessible to webpack, e.g. window };