score:0

just use the less plugin and declare them properly...

// webpack file
{
  test: /\.less$/,
  loader: "style-loader!css-loader!less-loader"
},
// i have to add the regex .*? because some of the files are named like... fontello.woff2?952370
{
  test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)(\?.*)?$/,
  loader: 'url?limit=50000'
}

// less file
@import '~bootstrap/less/bootstrap';

i am still working on the js but i will let you know soon :-)

score:8

you need to do the following things to make it work:

  1. in your webpack config file, resolve section, make sure your bootstrap css file path is included.

as an example:

var bootstrappath = path.join(
    __dirname,
    'development/bower_components/bootstrap/dist/css'
);

then in your webpack config object:

resolve: {
    alias: {
        jquery: path.join(__dirname, 'development/bower_components/jquery/jquery')
    },
    root: srcpath,
    extensions: ['', '.js', '.css'],
    modulesdirectories: ['node_modules', srcpath, commonstylepath, bootstrappath]
}
  1. make sure you have style loader and css loader. e.g. loaders:[{ test: /\.css$/, loader: "style-loader!css-loader" }]
  2. use it in your js file require('bootstrap.min.css');

Related Query

More Query from same tag