我是Django和ReactJS的新手,正在尝试使用本教程将简单的JSX代码编译为JS:http://geezhawk.github.io/2016/02/02/using-react-with-django-rest-framework .html
没有用,所以我npm run dev以前编译,现在它工作但是在浏览器控制台中出错:未捕获的ReferenceError:react未定义这是我的webpack.config.js
var path = require('path');
var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var nodeExternals = require('webpack-node-externals');
module.exports = {
//the base directory (absolute path) for resolving the entry option
context: __dirname,
//the entry point we created earlier. Note that './' means
//your current directory. You don't have to specify the extension now,
//because you will specify extensions later in the `resolve` section
entry: './assets/js/index',
output: {
//where you want your compiled …Run Code Online (Sandbox Code Playgroud)