小编Shu*_*aha的帖子

要求在捆绑的JS reactjs上没有定义错误

我是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)

javascript django npm reactjs react-jsx

1
推荐指数
1
解决办法
5400
查看次数

标签 统计

django ×1

javascript ×1

npm ×1

react-jsx ×1

reactjs ×1