webpack hot module replacement: css without refresh -
so far i've been using livereload whenever change js or templates, page refreshes, , when change css, hotswap new css without refresh.
i'm trying out webpack , got same behaviour, 1 exception: when css changes, refreshes whole window. possible make hotswap css without refresh?
config far:
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' } ] } };
this 1 of downsides of using extracttextplugin
stated in the project readme. can resolve issue splitting configuration. ie. have separate configuration development without , 1 production it.
Comments
Post a Comment