I have come across a solutions to this:
webpack.config.js
module: {
preLoaders: [
{test: /.js$/, exclude: /node_modules/, loader: 'jshint-loader'}
],
loaders: [
{test: /bootstrap/js//, loader: 'imports?jQuery=jquery' },
{test: /.less$/, loader: 'style-loader!css-loader!less-loader'},
{test: /.css$/, loader: 'style-loader!css-loader'},
{test: /.woff(2)?(?v=d+.d+.d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" },
{test: /.ttf(?v=d+.d+.d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" },
{test: /.eot(?v=d+.d+.d+)?$/, loader: "file" },
{test: /.svg(?v=d+.d+.d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" }
]
}
Make sure to install all these loaders
npm i jshint-loader style-loader css-loader less-loader url file --save-dev
After this import bootstrap in you file as
require('bootstrap/less/bootstrap.less');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…