@kristenstewartdadada
Frontend Developer

Настроил react-hot-loader, js заменяется без перезагрузки, но sass файлы не обновляются, что не так в конфиге?

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
        })
    ]
};
  • Вопрос задан
  • 278 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы