我遇到了一个错误,我认为是来自webpack的一方.这里是:
index.js:9 Uncaught ReferenceError: global is not defined
at eval (index.js:9)
at Object.<anonymous> (bundle.js:2548)
at __webpack_require__ (bundle.js:622)
at fn (bundle.js:48)
at eval (client:1)
at Object.<anonymous> (bundle.js:2541)
at __webpack_require__ (bundle.js:622)
at bundle.js:668
at bundle.js:671
Run Code Online (Sandbox Code Playgroud)
我的网站是:
import webpack from 'webpack';
import merge from 'webpack-merge';
import path from 'path';
import isDev from 'isdev';
import { Dir } from './src/utils';
const TARGET = process.env.npm_lifecycle_event;
let Config = {
entry: [
'babel-polyfill',
'react-hot-loader/patch',
path.join(Dir.src, 'client.js'),
],
output: {
path: path.join(Dir.public, 'build'),
filename: 'bundle.js',
},
target: …Run Code Online (Sandbox Code Playgroud)