当前位置:网站首页>Vite+web3: referenceerror: process is not defined
Vite+web3: referenceerror: process is not defined
2022-06-24 18:38:00 【Ren Lei ABC】
The recent use vite Scaffolding a blockchain project , need web3 This dependency Library , But introduce... Into the project web3 after , There is an error :

The solution is vite The configuration file vite.config.js It's equipped with :
// vite.config.js
import { defineConfig } from 'vite'
export default defineConfig({
⋮
resolve: {
alias: {
web3: 'web3/dist/web3.min.js',
},
// or
alias: [
{
find: 'web3',
replacement: 'web3/dist/web3.min.js',
},
],
},
})Then it can be introduced normally :
import web3 from 'web3';
console.log(web3);边栏推荐
- Redis series (3) - sentry highly available
- JS event details
- Mental models: the best way to make informed decisions - farnam
- How to perform power regression in R
- Six configuration management tools that administrators must know
- JS deep understanding of scope
- Digital trend analysis of B2B e-commerce market mode and trading capacity in electronic components industry
- Nine practical guidelines for improving responsive design testing
- JS string method
- Different JVM
猜你喜欢

How MySQL works - Chapter 14

Seven strategies for successfully integrating digital transformation

Exception: Gradle task assembleDebug failed with exit code 1

Digital transformation informatization data planning and technology planning

Project Management Guide: tips, strategies and specific practices

Two micro service interviews where small companies suffer losses
congratulate! The first dragon lizard community annual outstanding contribution award is announced. Check it now
[North Asia data recovery]_ mdb_ catalog. Mongodb database data recovery case in case of WT file corruption

Several key points for enterprises to pay attention to digital transformation

110. balanced binary tree
随机推荐
Three years of bug free, tips for improving code quality
Mariana Trench, Facebook's open source code analysis tool
How to perform power regression in R
Two micro service interviews where small companies suffer losses
Wechat applet to realize stacked rotation
next_ Permutation full permutation function
Leetcode daily question solution: 717 1-bit and 2-bit characters - reverse order
Sudoku (easy to understand)
Digital transformation informatization data planning and technology planning
Some knowledge of the beginning of 2022
JDBC writes Chinese garbled code to the database
Six configuration management tools that administrators must know
Easygbs video platform TCP active mode streaming exception repair
Window object
Leetcode skimming questions - the 72nd biweekly match and 281 weekly match
Redis learning -- list of redis operations
What is business intelligence (BI)?
Mental models: the best way to make informed decisions - farnam
On software requirement analysis
Selection (030) - what is the output of the following code?