Reactjs 不允许加载本地资源

Reactjs 不允许加载本地资源,reactjs,electron,mobx,mobx-react,Reactjs,Electron,Mobx,Mobx React,我期待着使用反应应用程序使用MobX框架,进入。 我成功地用React加载了MobX,但是当我尝试用Electron包装它时,我收到一条控制台错误消息不允许加载本地资源 我的包JSON: { "name": "electron-stuff", "version": "1.0.0", "description": "", "main": "src/electron.js", "scripts": { "babel": "babel", "webpack": "w

我期待着使用反应应用程序使用MobX框架,进入。 我成功地用React加载了MobX,但是当我尝试用Electron包装它时,我收到一条控制台错误消息
不允许加载本地资源

我的包JSON:

{
  "name": "electron-stuff",
  "version": "1.0.0",
  "description": "",
  "main": "src/electron.js",
  "scripts": {
    "babel": "babel",
    "webpack": "webpack",
    "start": "electron . --allow-file-access-from-files"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "mobx": "^2.3.7",
    "mobx-react": "^3.5.1",
    "react": "^15.2.1",
    "react-dom": "^15.3.0"
  },
  "devDependencies": {
    "babel-core": "^6.17.0",
    "babel-loader": "^6.2.4",
    "babel-plugin-transform-class-properties": "^6.10.2",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-react": "^6.11.1",
    "css-loader": "^0.23.1",
    "react-addons-test-utils": "^15.3.0",
    "style-loader": "^0.13.1",
    "webpack": "^1.13.1",
    "webpack-dev-server": "^1.14.1"
  }
}
My webpack.config.js

var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
var path = require('path');

module.exports = {
  context: path.join(__dirname, "src"),
  devtool: debug ? "inline-sourcemap" : null,
  entry: "./js/main.js",
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /(node_modules|bower_components)/,
        loader: 'babel-loader',
      },
      { test: /\.css$/, loader: "style-loader!css-loader" },
    ]
  },
  output: {
    path: path.join(__dirname, "src"),
    filename: "main.min.js"
  },
  plugins: debug ? [] : [
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
  ],
};

为什么电子说那里他不允许加载本地资源?electron不想访问本地文件?我该如何解决这个问题?

似乎我不小心走错了路。 问题解决了