I
I
Ilya2016-09-26 05:42:07
Sass
Ilya, 2016-09-26 05:42:07

I set up react-hot-loader, js is replaced without reloading, but sass files are not updated, what is wrong in the config?

var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var bourbon = require('node-bourbon').includePaths;

module.exports = {
    context: __dirname + "/app",
    entry: {
        main: "./main"
    },
    output: {
        path: __dirname + "/build",
        filename: "./bundle.js",
        // library: "[name]"
    },

    watch: true,

    sassLoader: {
        includePaths: [bourbon]
    },

    module: {
        loaders: [
            {
        		test: /\.json?$/,
        		loader: 'json-loader',
            },
            {
                test: /\.sass$/,
                loader: ExtractTextPlugin.extract('style-loader', 'css!sass')
            },
            //-------------------Fonts/Images----------------------
            {
                test: /\.woff2?$|\.ttf$|\.eot$|\.svg$|\.png|\.jpe?g|\.gif$/,
                loader: 'file-loader'
            },
            //---------------------ES6----------------------//
            {
        		test: /\.js?$/,
        		loader: 'babel-loader',
        		exclude: [/node_modules/, /build/],
            },
            {
        		test: /\.jsx?$/,
        		loader: 'babel-loader',
        		exclude: [/node_modules/, /build/],
            },
        ]

    },
    plugins: [
        // new webpack.HotModuleReplacementPlugin(),
        new ExtractTextPlugin('style.css', {
            allChunks: false
        })
    ]
};

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question