Webpack:'绑定未定义'

时间:2016-06-11 16:41:35

标签: javascript node.js reactjs webpack

我用nodejs(服务器)和reactjs(客户端)构建应用程序.. 一切都很好,但最近我有一些webpack的问题..之后我运行webpack我在浏览器控制台有错误:

  

未捕获的ReferenceError:未定义绑定

我对这个问题一无所知..有什么帮助吗?

这是我的webpack配置:

var ExtractTextPlugin = require('extract-text-webpack-plugin')
var webpack = require('webpack')

module.exports = {
  entry: [
    'babel-polyfill',
    './src/client/index.js'
  ],
  devtool: 'source-map',
  output: {
    path: './src/static/js/',
    filename: 'bundle.js'
  },
  module: {
    loaders: [{
      exclude: /node_modules/,
      loader: 'babel-loader',
      query: {
        presets: ['react', 'es2015', 'stage-1']
      }
    }, {
      test: /\.scss$/,
      loader: ExtractTextPlugin.extract('css!sass')
    }, {
      test: /\.json$/,
      loader: "json-loader"
    }],
    noParse: /lie\.js$|\/leveldown\//
  },
  node: {
    net: 'empty',
    fs: 'empty',
    dns: 'empty'
  },
  resolve: {
    extensions: ['', '.js', '.jsx']
  },
  plugins: [
    new ExtractTextPlugin('../css/style.css', {
      allChunks: true
    }),
    new webpack.ContextReplacementPlugin(/bindings$/, /^$/)
  ],
  externals: ["bindings"]
}

0 个答案:

没有答案