0

I have implemented webpack config like

   /* eslint-disable no-var */
var path = require('path');
var webpack = require('webpack');

module.exports = {
  entry: [
    'webpack-hot-middleware/client',
    './src/main'
  ],
  devtool: 'eval-source-map',
  output: {
    path: __dirname,
    filename: 'bundle.js',
    publicPath: '/static/'
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin()
  ],
  module: {
    loaders: [{
      test: /\.js$/,
      loaders: ['babel'],
      include: path.join(__dirname, 'src')
    },
    {
     test: /\.css$/, // Only .css files
     loader: 'style!css' // Run both loaders
   }
    ]
  }
};

and I have installed the css-loader style-loader for loding the css on my page and I am using the bootstrap.min.css as below

require('../../node_modules/bootstrap/dist/css/bootstrap.min.css');

it's throw error like

enter image description here

1 Answer 1

1

Bootstrap is using the Glyphicons font. You also need to have a loader for the font:

{
  test: /\.woff$/,
  loader: 'url?limit=100000'
}

Source: christianalfoni.github.io/react-webpack-cookbook/Inlining-fonts

Or:

{
  test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
  loader: 'file-loader'
}

Source: stackoverflow.com/a/31183889/2378031

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.