[英]How to read Firebase Node.js module?
The problem is that require
is a function provided by node.js's 'module' module. 问题是
require
是node.js的“模块”模块提供的功能。 It is not part of the ES5 spec, and so it is not natively available in web browsers. 它不是ES5规范的一部分,因此它本身在Web浏览器中不可用。
In order to load modules using require
, you will have to use a web bundler (like Webpack , Browserify or RequireJS ). 为了使用
require
加载模块,您将必须使用Web捆绑程序(例如Webpack , Browserify或RequireJS )。 This will bundle together all of the JS in your project into a single file, automatically handling calls to require
. 这会将项目中的所有JS捆绑到一个文件中,自动处理对
require
调用。
I'd recommend reading Getting started with Webpack to get you on your way. 我建议阅读“ Webpack入门”以助您一臂之力 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.