javascript - How do I listen for webpack (watchpack) changes in --watch mode? -
i'm experimenting webpack , call function everytime webpack/watchpack detects changes when in --watch
mode. watchpack api describes .on('change')
method, how can hook running instance of watchpack?
executing this:
webpack --watch --colors --progress
and here webpack.config.js:
var extracttextplugin = require('extract-text-webpack-plugin'); module.exports = { entry: { style: './styles/master.less', homepage: './styles/homepage.less', messaging: './styles/messaging.less', places: './styles/places.less', profile: './styles/profile.less', }, output: { filename: '_tmp/[name].js' }, module: { loaders: [ { test: /\.less$/, exclude: /node_modules/, loader: extracttextplugin.extract('raw!less') } ] }, plugins: [ new extracttextplugin('_tmp/[name].css') ] };
i've tried creating preloader, since loaders intended processing source code, it's not way go.
Comments
Post a Comment