Skip to content

Commit

Permalink
Fix gray-matter build in WebPack.
Browse files Browse the repository at this point in the history
  • Loading branch information
tech4him1 committed Sep 14, 2017
1 parent afc73e6 commit 362ec92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
};

0 comments on commit 362ec92

Please sign in to comment.