Skip to content

Commit

Permalink
fix(example): fix for broken sass and add watch
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Aug 28, 2017
1 parent 29ced70 commit 47ba43e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ const threadLoader = require('thread-loader'); // eslint-disable-line import/no-
module.exports = (env) => {
const workerPool = {
workers: +env.threads,
poolTimeout: env.watch ? Infinity : 2000,
};
threadLoader.warmup(workerPool, ['babel-loader', 'babel-preset-env', 'sass-loader', 'css-loader']);
const workerPoolSass = {
workers: +env.threads,
workerParallelJobs: 2,
poolTimeout: env.watch ? Infinity : 2000,
};
if (+env.threads > 0) {
threadLoader.warmup(workerPool, ['babel-loader', 'babel-preset-env']);
threadLoader.warmup(workerPoolSass, ['sass-loader', 'css-loader']);
}
return {
context: __dirname,
entry: ['react', 'lodash-es', './index.js'],
Expand All @@ -32,7 +41,7 @@ module.exports = (env) => {
use: [
env.threads !== 0 && {
loader: 'thread-loader',
options: workerPool,
options: workerPoolSass,
},
'css-loader',
'sass-loader',
Expand Down

0 comments on commit 47ba43e

Please sign in to comment.