We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm run vite-dev error 'require is not defined' const modulesFiles = require.context('./modules', true, /.js$/)
The text was updated successfully, but these errors were encountered:
Using vite means that you may give up those libraries which don't provide an ES Module format bundle or can't be transformed to ES Module.
参阅文档 「 依赖预构建 」 CommonJS 和 UMD 兼容性: 开发阶段中,Vite 的开发服务器将所有代码视为原生 ES 模块。因此,Vite 必须先将作为 CommonJS 或 UMD 发布的依赖项转换为 ESM。
参阅文档 「 依赖预构建 」
CommonJS 和 UMD 兼容性: 开发阶段中,Vite 的开发服务器将所有代码视为原生 ES 模块。因此,Vite 必须先将作为 CommonJS 或 UMD 发布的依赖项转换为 ESM。
若你使用的库及其源码本身仅提供 CommonJS 而不提供 ESM 的格式,或确认无法经过 Vite 的处理转换为 ESM,那么在 Vite 开发过程中当中将无法使用该库。
Sorry, something went wrong.
No branches or pull requests
npm run vite-dev error 'require is not defined'
const modulesFiles = require.context('./modules', true, /.js$/)
The text was updated successfully, but these errors were encountered: