除非要尝试使用fs
或来自nodejs的类似模块,否则在大多数情况下,我会努力使这3个游戏一起玩得很开心。
我发现我需要使用externals
来发现一个名为nodeExternals
的程序包,而不要打包环境将提供的内容。我的狙击手如下:
target: "electron-renderer",
externals: [
nodeExternals({
path: "./node_modules",
whitelist: ["react", "react-dom", "gphoto2"],
}),
],
我得到的错误是:
external_"object-assign":1 Uncaught ReferenceError: require is not defined
at eval (external_"object-assign":1)
at Object.object-assign (renderer.bundle.js:291)
at __webpack_require__ (renderer.bundle.js:20)
at eval (react.development.js:18)
at eval (react.development.js:1900)
at Object../node_modules/react/cjs/react.development.js (renderer.bundle.js:166)
at __webpack_require__ (renderer.bundle.js:20)
at eval (index.js:4)
at Object../node_modules/react/index.js (renderer.bundle.js:178)
at __webpack_require__ (renderer.bundle.js:20)
我使用了以下资源:
我可以得到一些提示/解释,这是怎么回事?我有点迷路了。