Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.22 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.22 KB

webpack-react-bootstrap

This is an bootstrap/react sample with webpack.

The bootstrap is the sass version from here.

Install

Just run npm install is ok.

Note: npm 需要使用v5.0.0以上, 否则不能支持某些loader(例如:sass-loader)

Usage

Some sass/css/fonts that needed by Bootstrap, have been configured the correct loaders in webpack.config.js, you can modify or add loader that you need in it.

Example:

module.exports = {
  module: {
    loaders: [
        {
            test: /\.scss$/,
            exclude: /(node_modules|bower_components)/,
            loader: 'style-loader!css-loader!sass-loader?sourceMap'
        },
    ]
  }
};

Bootstrap javascript components depends on jQuery. We add the jQuery to global namespace in webpack app by the following code in webpack.config.js:

plugins: [
    new webpack.ProvidePlugin({
        $: "jquery",
        jQuery: "jquery",
        "window.jQuery": "jquery"
    })
]

Custom

You can set your private variables in the following file:

app/scss/_avriables.scss

Enjoy!

Run npm run dev and open http://localhost:8080/