使用webpack进行反应引导

我正在尝试使用反馈引导与web包。我能够得到一个引导< Button>在一个页面上,但是没有附加的样式?
我已经安装:

 "devDependencies": {
    "babel-core": "^5.1.11",
    "babel-loader": "^5.0.0",
    "css-loader": "^0.12.1",
    "react-hot-loader": "^1.2.2",
    "react-router": "^0.13.3",
    "webpack": "^1.7.2",
    "webpack-dev-server": "^1.7.0"
  },
  "dependencies": {
    "bootstrap": "^3.3.4",
    "react": "^0.13.0",
    "react-bootstrap": "^0.22.6",
    "whatwg-fetch": "^0.8.1"
  }
}

webpack.config.js中的装载器

  module: {
    loaders: [
      { test: /\.jsx?$/, loaders: ['react-hot', 'babel'], include: path.join(__dirname, 'app') },
      { test: /\.css$/, loader: "style-loader!css-loader" },
      { test: /\.png$/, loader: "url-loader?limit=100000" },
      { test: /\.jpg$/, loader: "file-loader" }
    ]
  }
最佳答案
react-bootstrap不包括引导样式。

当他们把它放在他们的Getting Started页面上:

  • Because many folks use custom Bootstrap themes, we do not directly depend on Bootstrap. It is up to you to to determine how you get and link to the Bootstrap CSS and fonts.

您应该从引导/ css / bootstrap.css导入样式。由于您已经有一个css文件的加载器设置,并且依赖于引导,所以简单

require('bootstrap/css/bootstrap.css');

转载注明原文:使用webpack进行反应引导 - 代码日志