Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Native workers #29

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disable thread-loader for sass
  • Loading branch information
7rulnik committed Jul 1, 2018
commit 4c0aa4b321ce56e16d622d7e5811e777ca0d7948
14 changes: 8 additions & 6 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin'); // eslint-disable-line import/no-extraneous-dependencies
const threadLoader = require('thread-loader'); // eslint-disable-line import/no-extraneous-dependencies
// const threadLoader = require('thread-loader'); // eslint-disable-line import/no-extraneous-dependencies

module.exports = (env) => {
const workerPool = {
Expand All @@ -12,10 +12,12 @@ module.exports = (env) => {
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']);
}

// TODO: fix me
// 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 @@ -39,7 +41,7 @@ module.exports = (env) => {
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: [
env.threads !== 0 && {
false && env.threads !== 0 && {
loader: 'thread-loader',
options: workerPoolSass,
},
Expand Down