webpack hot-Modul-Ersatz: css ohne refresh

Bisher habe ich mit livereload, so dass, wenn ich ändern, JS, templates oder wird die Seite aktualisiert, und wenn ich CSS, es würde hotswap-die neue CSS ohne refresh.

Ich versuche webpack jetzt und habe fast die selbe Verhalten, mit einer Ausnahme: wenn die CSS-änderungen, frischt es das ganze Fenster. Ist es möglich zu machen, hotswap-CSS-ohne refresh?

Config so weit:

var webpackConfig = {
    entry: ["webpack/hot/dev-server", __dirname + '/app/scripts/app.js'],
    debug: true,
    output: {
        path: __dirname + '/app',
        filename: 'scripts/build.js'
    },
    devtool: 'source-map',
    plugins: [
        new webpack.HotModuleReplacementPlugin(),
        new htmlWebpackPlugin({
            template: __dirname + '/app/index.html',
            inject: 'body',
            hash: true,
            config: config
        }),
        new webpack.ProvidePlugin({
            'angular': 'angular'
        }),
        new ExtractTextPlugin("styles.css")
    ],
    module: {
        loaders: [
            {
                test: /\.scss$/,
                loader: "style!css!sass?includePaths[]=" + __dirname + "/app/bower_components/compass-mixins/lib&includePaths[]=" + __dirname + '/instance/sth/styles&includePaths[]=' + __dirname + '/app/scripts'
            }
        ]
    }
};
Schreibe einen Kommentar