Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.modifyWebpackConfig = function modifyWebpackConfig({config, stage}) {
config.removeLoader('md')
config.loader('md', {
test: /\.md$/,
loader: 'babel-loader!reactdown/webpack'
})
if (stage === 'build-html') {
const pages = config._config.plugins[0].paths
config._config.plugins[0] = new StaticSiteGeneratorPlugin({
entry: `render-page.js`,
paths: pages,
globals: {
DOMParser: xmldom.DOMParser,
NodeList: xmldom.NodeList,
atob: function atob(str) {
return new Buffer(str, 'base64').toString('binary');
},
location: {
pathname: ''
},
document: {
addEventListener: () => null,
removeEventListener: () => null
}
}
})
}
return config
}
exports.modifyWebpackConfig = function modifyWebpackConfig({config, stage}) {
config.removeLoader('md')
config.loader('md', {
test: /\.md$/,
loader: 'babel-loader!reactdown/webpack'
})
if (stage === 'build-html') {
const pages = config._config.plugins[0].paths
config._config.plugins[0] = new StaticSiteGeneratorPlugin({
entry: `render-page.js`,
paths: pages,
globals: {
DOMParser: xmldom.DOMParser,
NodeList: xmldom.NodeList,
atob: function atob(str) {
return new Buffer(str, 'base64').toString('binary');
},
location: {
pathname: ''
},
document: {
addEventListener: () => null,
removeEventListener: () => null
}
}
})
}
return config
}