Skip to content

升级WebPack5后希望继续使用crypto和buffer的问题 #13657

Answered by yoyo837
zspggp asked this question in Q & A
Discussion options

You must be logged in to vote
new webpack.ProvidePlugin({
  // 浏览器兼容 webpack 4 的 Buffer
  Buffer: ['buffer', 'Buffer'],
  // 浏览器兼容 webpack 4 的 process
  'process.browser': JSON.stringify(true),
}),

Replies: 4 comments 11 replies

Comment options

You must be logged in to vote
4 replies
@pisyell
Comment options

@Solyna
Comment options

@yoyo837
Comment options

@Solyna
Comment options

Answer selected by ZakaryCode
Comment options

You must be logged in to vote
5 replies
@pisyell
Comment options

@yoyo837
Comment options

@pisyell
Comment options

@yoyo837
Comment options

@Solyna
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Solyna
Comment options

@BLJJ-DBLD
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q & A
Labels
None yet
7 participants
Converted from issue

This discussion was converted from issue #13656 on April 14, 2023 06:17.