Javascript React styleguidist ReferenceError:未定义进程
我将react styleguidist添加到我的项目中。现在,在运行npm run styleguidist时,发生了一个错误ReferenceError:未定义进程 My styleguide.config.js:Javascript React styleguidist ReferenceError:未定义进程,javascript,reactjs,webpack,Javascript,Reactjs,Webpack,我将react styleguidist添加到我的项目中。现在,在运行npm run styleguidist时,发生了一个错误ReferenceError:未定义进程 My styleguide.config.js: module.exports = { title: 'Style Guide', pagePerSection: true, sections: [{ name: 'components', section
module.exports = {
title: 'Style Guide',
pagePerSection: true,
sections: [{
name: 'components',
sectionDepth: 1,
components: './src/components/button.jsx'
},
],
}
考虑到您没有添加任何关于设置的解释,我将在回答中做出许多假设。 您使用的是哪个版本的网页包?我认为它可能与v5有关,因为它不再使用进程依赖关系,而
styleguidist
仍然依赖v4,而v4确实如此
您可以通过更新您的网页配置暂时解决此问题:
plugins:[
new webpack.DefinePlugin({
process: { env: {} }
})
]
此代码段中的
process
在哪里?在我的webpack.config.js中