Webpack + bootstrap

webpack에서 bootstrap 써먹기.

npm install jquery bootstrap url-loader imports-loader file-loader style-loader css-loader 
In webpack.config.js
module: {
loaders: [
{test: /\.js$/, loader: 'babel', exclude: /node_modules/},
{test: /\.css$/, loader: 'style!css'},
{test: /bootstrap\/js\//, loader: 'imports?jQuery=jquery'},
{test: /\.woff[2]?(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff"},
{test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/octet-stream"},
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"},
{test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=image/svg+xml"}
]
}
In [module file].js
ex) To load bootstrap css
require('bootstrap/dist/css/bootstrap.min.css');
ex) To open a modal dialog
var $ = require('jquery')
$('#root').modal()

뭐하나 쉬운게 없다.