webpack React is not defined

  • webpack React is not defined已关闭评论
  • 244 views
  • A+
所属分类:JavaScript
const path = require("path");

const HtmlWebpackPlugin = require('html-webpack-plugin');

const webpack = require('webpack');

module.exports = {
    ...
    plugins: [
        new webpack.ProvidePlugin({
            "React": "react",
        }) //添加这句
    ]
    ...
};
  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin